Skip to content

Commit c905e93

Browse files
committed
Kubernetes: Add namespace and labels to pgadmin resources, enhance resource management with readiness and liveness probes, and update service type to ClusterIP
Signed-off-by: NotHarshhaa <[email protected]>
1 parent fe609da commit c905e93

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

Diff for: database-management/pgadmin/pgadmin.yml

+28-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ apiVersion: v1
33
kind: PersistentVolumeClaim
44
metadata:
55
name: pgadmin
6+
namespace: database-management
7+
labels:
8+
app: pgadmin
69
spec:
710
accessModes:
811
- ReadWriteOnce
@@ -14,6 +17,9 @@ apiVersion: apps/v1
1417
kind: Deployment
1518
metadata:
1619
name: pgadmin
20+
namespace: database-management
21+
labels:
22+
app: pgadmin
1723
spec:
1824
replicas: 1
1925
selector:
@@ -25,20 +31,32 @@ spec:
2531
app: pgadmin
2632
spec:
2733
containers:
28-
- env:
34+
- name: pgadmin
35+
image: dpage/pgadmin4
36+
ports:
37+
- containerPort: 80
38+
env:
2939
- name: PGADMIN_DEFAULT_EMAIL
3040
3141
- name: PGADMIN_DEFAULT_PASSWORD
3242
value: keyboardcat
3343
- name: PGADMIN_PORT
3444
value: "80"
35-
image: dpage/pgadmin4
36-
name: pgadmin
37-
ports:
38-
- containerPort: 80
3945
volumeMounts:
4046
- mountPath: /var/lib/pgadmin
4147
name: pgadmin
48+
readinessProbe:
49+
httpGet:
50+
path: /
51+
port: 80
52+
initialDelaySeconds: 5
53+
periodSeconds: 10
54+
livenessProbe:
55+
httpGet:
56+
path: /
57+
port: 80
58+
initialDelaySeconds: 15
59+
periodSeconds: 20
4260
volumes:
4361
- name: pgadmin
4462
persistentVolumeClaim:
@@ -47,13 +65,14 @@ spec:
4765
apiVersion: v1
4866
kind: Service
4967
metadata:
68+
name: pgadmin
69+
namespace: database-management
5070
labels:
5171
app: pgadmin
52-
name: pgadmin
5372
spec:
5473
ports:
55-
- nodePort: 30165
56-
port: 80
74+
- port: 80
75+
targetPort: 80
5776
selector:
5877
app: pgadmin
59-
type: NodePort
78+
type: ClusterIP

0 commit comments

Comments
 (0)