apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.service: mysql
  name: mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        io.kompose.service: mysql
    spec:
      containers:
      - env:
        - name: MYSQL_DATABASE
          value: todos
        - name: MYSQL_PASSWORD
          value: dummytodos
        - name: MYSQL_ROOT_PASSWORD
          value: dummypassword
        - name: MYSQL_USER
          value: todos-user
        image: mysql:5.7
        args:
          - "--ignore-db-dir=lost+found"
        imagePullPolicy: Always
        name: mysql
        ports:
        - containerPort: 3306
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: mysql-database-data-volume
      restartPolicy: Always
      volumes:
      - name: mysql-database-data-volume
        persistentVolumeClaim:
          claimName: mysql-database-data-volume