apiVersion: v1
kind: Service
metadata:
  name: phpmyadmin-reevolution
  namespace: reevolution
  labels:
    app: reevolution
spec:
  selector:
    app: reevolution
    tier: phpmyadmin
  type: NodePort
  ports:
    - name: phpadmin
      port: 80
      nodePort: 30289
      targetPort: phpmyadm
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: phpmyadmin-reevolution
  namespace: reevolution
  labels:
    app: reevolution
spec:
  selector:
    matchLabels:
      app: reevolution
      tier: phpmyadmin
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: reevolution
        tier: phpmyadmin
    spec:
      containers:
        - name: phpmyadmin
          image: arm64v8/phpmyadmin
          ports:
            - containerPort: 80
              name: phpmyadm
          env:
            - name: PMA_HOST
              value: reevolution-mysql
            - name: PMA_PORT
              value: "3306"
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: reevolution-pass
                  key: password
