apiVersion: apps/v1 
kind: Deployment
metadata:
  name: phpmyadmin
  namespace: wordpress-stack
  labels:
    app.kubernetes.io/name: phpmyadmin
    app.kubernetes.io/creator: hossein-yousefi
    app.kubernetes.io/stack: wordpress
    app.kubernetes.io/env: production
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: phpmyadmin
      app.kubernetes.io/creator: hossein-yousefi
      app.kubernetes.io/stack: wordpress
      app.kubernetes.io/env: production
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/name: phpmyadmin
        app.kubernetes.io/creator: hossein-yousefi
        app.kubernetes.io/stack: wordpress
        app.kubernetes.io/env: production
    spec:
      containers:
      - image: phpmyadmin:5.1
        name: phpmyadmin
        env:
        - name: PMA_HOST
          value: mysql
        - name: PMA_PORT
          value: '3306'
        - name: PMA_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-pass
              key: password
        - name: PMA_USER
          value: root
        - name: PMA_ABSOLUTE_URI
          value: http://phpmyadmin.hosein.local

        ports:
        - containerPort: 80

