apiVersion: apps/v1
kind: Deployment 
metadata:
  name: mysql
spec:
  selector:
    matchLabels:
      app: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels: 
        app: mysql 
    spec:
      terminationGracePeriodSeconds: 5
      containers:
      - name: mysql
        image:  mysql:5.6
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: password
        ports:
          - name: mysql
            containerPort: 3306
        resources:
          requests: 
            cpu: 1000m
            memory: 512Mi
          limits:
            cpu: 2000m
            memory: 2048Mi
        volumeMounts:
          - name: mysql-persistent-storage
            mountPath: /var/lib/mysql
      volumes:
        - name: mysql-persistent-storage
          persistentVolumeClaim:
            claimName: mysql-pv-claim


