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