apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql-snap
spec:
  selector:
    matchLabels:
      app: mysql-snap
  replicas: 1
  template:
    metadata:
      labels:
        app: mysql-snap
    spec:
      schedulerName: stork
      containers:
      - name: mysql
        image: mysql:5.6.32
        imagePullPolicy: "IfNotPresent"
        ports:
        - containerPort: 5432
        env:
        - name: MYSQL_USER
          value: mysql
        - name: MYSQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-pass
              key: password.txt
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-pass
              key: password.txt
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: mysql
      volumes:
      - name: mysql
        persistentVolumeClaim:
          claimName: px-mysql-snap-clone
