apiVersion: v1
kind: Service
metadata:
 name: pgadmin-service
 namespace: pgadmin
spec:
 ports:
 - protocol: TCP
   port: 80
   targetPort: http
   nodePort: 32567
 selector:
   app: pgadmin
 type: NodePort
---

apiVersion: apps/v1
kind: StatefulSet
metadata:
 name: pgadmin-deployment
 namespace: pgadmin
spec:
 serviceName: pgadmin-service
 podManagementPolicy: Parallel
 replicas: 1
 updateStrategy:
   type: RollingUpdate
 selector:
   matchLabels:
     app: pgadmin
 template:
   metadata:
     labels:
       app: pgadmin
   spec:
     terminationGracePeriodSeconds: 10
     containers:
       - name: pgadmin
         image: dpage/pgadmin4:latest
         #imagePullPolicy: Always
         env:
         - name: PGADMIN_DEFAULT_EMAIL
           value: pgadmin@remiges.tech
         - name: PGADMIN_DEFAULT_PASSWORD
           valueFrom:
             secretKeyRef:
               name: pgadmin
               key: pgadmin-password
         ports:
         - name: http
           containerPort: 80
           protocol: TCP
         volumeMounts:
         #- name: pgadmin-config
         #  mountPath: /pgadmin4/servers.json
         #  subPath: servers.json
         #  readOnly: true
         - name: pgadmin-data
           mountPath: /var/lib/pgadmin
     nodeSelector:
       name: master
     volumes:
     #- name: pgadmin-config
     #  configMap:
     #    name: pgadmin-config
     - name: pgadmin-data
       persistentVolumeClaim:
         claimName: pgadmin-pvc
