File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
internal/controller/standalone_pgadmin
testing/kuttl/e2e/standalone-pgadmin/files Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,26 @@ func pod(
154
154
},
155
155
},
156
156
}
157
+
158
+ // Creating a readiness probe that will check that the pgAdmin `/login`
159
+ // endpoint is reachable at the specified port
160
+ readinessProbe := & corev1.Probe {
161
+ ProbeHandler : corev1.ProbeHandler {
162
+ HTTPGet : & corev1.HTTPGetAction {
163
+ Port : * initialize .IntOrStringInt32 (pgAdminPort ),
164
+ Path : "/login" ,
165
+ Scheme : corev1 .URISchemeHTTP ,
166
+ },
167
+ },
168
+ }
169
+ gunicornData := inConfigMap .Data [gunicornConfigKey ]
170
+ // Check the configmap to see if we think TLS is enabled
171
+ // If so, update the readiness check scheme to HTTPS
172
+ if strings .Contains (gunicornData , "certfile" ) && strings .Contains (gunicornData , "keyfile" ) {
173
+ readinessProbe .ProbeHandler .HTTPGet .Scheme = corev1 .URISchemeHTTPS
174
+ }
175
+ container .ReadinessProbe = readinessProbe
176
+
157
177
startup := corev1.Container {
158
178
Name : naming .ContainerPGAdminStartup ,
159
179
Command : startupCommand (),
Original file line number Diff line number Diff line change @@ -111,6 +111,11 @@ containers:
111
111
- containerPort: 5050
112
112
name: pgadmin
113
113
protocol: TCP
114
+ readinessProbe:
115
+ httpGet:
116
+ path: /login
117
+ port: 5050
118
+ scheme: HTTP
114
119
resources: {}
115
120
securityContext:
116
121
allowPrivilegeEscalation: false
@@ -291,6 +296,11 @@ containers:
291
296
- containerPort: 5050
292
297
name: pgadmin
293
298
protocol: TCP
299
+ readinessProbe:
300
+ httpGet:
301
+ path: /login
302
+ port: 5050
303
+ scheme: HTTP
294
304
resources:
295
305
requests:
296
306
cpu: 100m
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ metadata:
26
26
postgres-operator.crunchydata.com/data : pgadmin
27
27
postgres-operator.crunchydata.com/role : pgadmin
28
28
postgres-operator.crunchydata.com/pgadmin : pgadmin
29
+ spec :
30
+ containers :
31
+ - name : pgadmin
32
+ readinessProbe :
33
+ httpGet :
34
+ path : /login
35
+ port : 5050
36
+ scheme : HTTP
29
37
status :
30
38
containerStatuses :
31
39
- name : pgadmin
You can’t perform that action at this time.
0 commit comments