112 lines
2.4 KiB
YAML
112 lines
2.4 KiB
YAML
---
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: pgadmin
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: pgadmin-data-pvc
|
|
namespace: pgadmin
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
storageClassName: nfs-storage
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
---
|
|
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: pgadmin-auth
|
|
namespace: pgadmin
|
|
type: Opaque
|
|
data:
|
|
pgadmin-password: QmxhY2tzdGFyMkBob21l
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: pgadmin-config
|
|
namespace: pgadmin
|
|
data:
|
|
PGADMIN_DEFAULT_EMAIL: "khwezi@litecharms.co.za"
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: pgadmin
|
|
namespace: pgadmin
|
|
labels:
|
|
app: pgadmin
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: pgadmin
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: pgadmin
|
|
spec:
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: node-role.kubernetes.io/control-plane
|
|
operator: DoesNotExist
|
|
securityContext:
|
|
runAsUser: 5050
|
|
fsGroup: 5050
|
|
containers:
|
|
- name: pgadmin
|
|
image: dpage/pgadmin4:latest
|
|
ports:
|
|
- containerPort: 80
|
|
name: http
|
|
env:
|
|
- name: PGADMIN_DEFAULT_EMAIL
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: pgadmin-config
|
|
key: PGADMIN_DEFAULT_EMAIL
|
|
- name: PGADMIN_DEFAULT_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: pgadmin-auth
|
|
key: pgadmin-password
|
|
- name: PGADMIN_CONFIG_UPGRADE_CHECK_ENABLED
|
|
value: "False"
|
|
resources:
|
|
requests:
|
|
cpu: "100m"
|
|
memory: "256Mi"
|
|
limits:
|
|
cpu: "500m"
|
|
memory: "512Mi"
|
|
volumeMounts:
|
|
- name: pgadmin-storage
|
|
mountPath: /var/lib/pgadmin
|
|
volumes:
|
|
- name: pgadmin-storage
|
|
persistentVolumeClaim:
|
|
claimName: pgadmin-data-pvc
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: pgadmin-service
|
|
namespace: pgadmin
|
|
spec:
|
|
type: NodePort
|
|
selector:
|
|
app: pgadmin
|
|
ports:
|
|
- name: http
|
|
protocol: TCP
|
|
port: 80
|
|
targetPort: 80
|
|
nodePort: 32081 |