apiVersion: v1
kind: Service
metadata:
  name: phpmyadmin-gogs
  namespace: gogs
  labels:
    app: gogs
spec:
  selector:
    app: gogs
    tier: phpmyadmin
  type: NodePort
  ports:
    - name: phpadmin
      port: 80
      nodePort: 30382
      targetPort: phpmyadm
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: phpmyadmin-gogs
  namespace: gogs
  labels:
    app: gogs
spec:
  selector:
    matchLabels:
      app: gogs
      tier: phpmyadmin
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: gogs
        tier: phpmyadmin
    spec:
      containers:
        - name: phpmyadmin
          image: docker-registry:32000/phpmyadmin:1.0
          ports:
            - containerPort: 80
              name: phpmyadm
          env:
            - name: PMA_HOST
              value: gogs-mysql
            - name: PMA_PORT
              value: "3306"
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysqlgogs-pass
                  key: password
      imagePullSecrets:
      - name: reg-cred-secret
