apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: uat
  name: mysql-db
  labels:
    name: mysql-db
    app: mysql-db
spec:
  selector:
    matchLabels:
      app: mysql-db
  template:
    metadata:
      name: mysql-db
      labels:
        name: mysql-db
        app: mysql-db
    spec:
      containers:
        - name: mysql-db
          imagePullPolicy: Always
          image: mysql:5.7
          volumeMounts:
            - mountPath: /var/lib/mysql
              name: mysql-storage
              subPath: mysql
          ports:
            - containerPort: 3306
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: root
            - name: MYSQL_DATABASE
              value: livelihoodzones
            - name: MYSQL_USER
              value: sevenskies
            - name: MYSQL_PASSWORD
              value: "sevenskies"
      volumes:
        - name: mysql-storage
          persistentVolumeClaim:
            claimName: mysql-pvc