apiVersion: apps/v1
kind: Deployment
metadata:
  name: phpmyadmin
  labels:
    app: phpmyadmin
spec:
  selector:
    matchLabels:
      app: phpmyadmin
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: phpmyadmin
    spec:
      containers:
        - image: phpmyadmin/phpmyadmin:4.7.7
          name: phpmyadmin
          env:
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql-secret
                  key: root-password
            - name: MYSQL_USER
              valueFrom:
                secretKeyRef:
                  name: mysql-secret
                  key: user
            - name: MYSQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql-secret
                  key: password
            - name: PMA_HOST
              value: mysql.apollo:3306
          ports:
            - containerPort: 80
              name: phpmyadmin
