File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11---
2+ apiVersion : v1
3+ kind : ConfigMap
4+ metadata :
5+ name : pgadmin-servers
6+ namespace : udc-bot-dev
7+ labels :
8+ app.kubernetes.io/name : pgadmin
9+ app.kubernetes.io/part-of : udc-bot
10+ environment : dev
11+ data :
12+ servers.json : |
13+ {
14+ "Servers": {
15+ "1": {
16+ "Name": "UDC Bot - PostgreSQL (Dev)",
17+ "Group": "Servers",
18+ "Host": "postgresql",
19+ "Port": 5432,
20+ "MaintenanceDB": "udcbot",
21+ "Username": "udcbot",
22+ "SSLMode": "prefer",
23+ "PassFile": "/tmp/pgpass"
24+ }
25+ }
26+ }
27+ ---
228apiVersion : apps/v1
329kind : Deployment
430metadata :
2046 app.kubernetes.io/part-of : udc-bot
2147 environment : dev
2248 spec :
49+ initContainers :
50+ - name : create-pgpass
51+ image : busybox:1.36
52+ command :
53+ - sh
54+ - -c
55+ - |
56+ echo "postgresql:5432:udcbot:udcbot:${PGPASSWORD}" > /pgpass/pgpass
57+ chmod 600 /pgpass/pgpass
58+ env :
59+ - name : PGPASSWORD
60+ valueFrom :
61+ secretKeyRef :
62+ name : postgresql-credentials
63+ key : password
64+ volumeMounts :
65+ - name : pgpass
66+ mountPath : /pgpass
67+ securityContext :
68+ allowPrivilegeEscalation : false
2369 containers :
2470 - name : pgadmin
2571 image : dpage/pgadmin4:8.14
3480 secretKeyRef :
3581 name : pgadmin-credentials
3682 key : password
83+ - name : PGADMIN_SERVER_JSON_FILE
84+ value : /pgadmin4/servers.json
85+ volumeMounts :
86+ - name : servers-config
87+ mountPath : /pgadmin4/servers.json
88+ subPath : servers.json
89+ readOnly : true
90+ - name : pgpass
91+ mountPath : /tmp/pgpass
92+ subPath : pgpass
93+ readOnly : true
3794 resources :
3895 requests :
3996 cpu : 25m
@@ -49,6 +106,12 @@ spec:
49106 periodSeconds : 10
50107 securityContext :
51108 allowPrivilegeEscalation : false
109+ volumes :
110+ - name : servers-config
111+ configMap :
112+ name : pgadmin-servers
113+ - name : pgpass
114+ emptyDir : {}
52115---
53116apiVersion : v1
54117kind : Service
You can’t perform that action at this time.
0 commit comments