apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: streaming-mysql
  name: streaming-mysql
spec:
  selector:
    matchLabels:
      app: streaming-mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: streaming-mysql
    spec:
      containers:
      - image: mysql:5.6
        name: streaming-mysql
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: password
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: streaming-mysql-pv
          mountPath: /var/lib/mysql
      volumes:
      - name: streaming-mysql-pv
        persistentVolumeClaim:
          claimName: streaming-mysql-pvc