apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql
spec:
  selector:
    matchLabels:
      app: mysql
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: mysql
    spec:
      nodeSelector:
        cloud.google.com/gke-nodepool: default-pool
      containers:
      - image: sfcdota/mysql
        name: mysql
        imagePullPolicy: Always
        resources:
          requests:
            memory: "16Mi"
            cpu: "1m"
          limits:
            memory: "128Mi"
            cpu: "100m"
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: mysql-persistent-storage
          mountPath: /var/lib/mysql
        - name: sys-persistent-storage
          mountPath: /sys/fs/cgroup
      volumes:
      - name: mysql-persistent-storage
        persistentVolumeClaim:
          claimName: mysql-pv-claim
      - name: sys-persistent-storage
        persistentVolumeClaim:
          claimName: sys-pv-claim
