apiVersion: apps/v1
kind: ReplicaSet
metadata:
    name: mysqldb
    labels:
        app: mysql
spec:
    replicas: 1
    selector:
        matchLabels:
            app: mysql
    template:
        metadata:
            labels:
                app: mysql
        spec:
            volumes:
                - name: mysql-db
                  persistentVolumeClaim:
                      claimName: mysqldb
            containers:
                - name: mysqldb
                  image: mysql:5.6
                  env:
                      - name: MYSQL_ROOT_PASSWORD
                        value: passw0rd
                  ports:
                      - containerPort: 3306
                  volumeMounts:
                      - name: mysql-db
                        mountPath: "/var/lib/mysql"
