Skip to content

Commit 2f7d0af

Browse files
committed
Limit alloyDB connections to 127.0.0.1. Refactor readiness probe to use alloydb proxy health check flag. Add liveness probe to alloy db proxy. Add startup probes to both containers. Limit connections on health check to pod IP.
1 parent 9e077c8 commit 2f7d0af

1 file changed

Lines changed: 39 additions & 7 deletions

File tree

applications/prompt-pub/templates/statefulset.yaml

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,20 @@ spec:
7171
value: "0"
7272
- name: AWS_REQUEST_CHECKSUM_CALCULATION
7373
value: WHEN_REQUIRED
74+
startupProbe:
75+
httpGet:
76+
path: /readiness
77+
port: 9040
78+
failureThreshold: 20
79+
periodSeconds: 5
7480
readinessProbe:
75-
tcpSocket:
76-
port: 5432
81+
httpGet:
82+
path: /readiness
83+
port: 9040
7784
initialDelaySeconds: 2
7885
periodSeconds: 5
86+
timeoutSeconds: 3
87+
failureThreshold: 3
7988
volumeMounts:
8089
- name: gcp-int-repo-config-volume
8190
mountPath: /opt/lsst/configs/gcp-repo-path
@@ -92,16 +101,39 @@ spec:
92101
command:
93102
- "/alloydb-auth-proxy"
94103
- "--public-ip"
95-
- "--address=0.0.0.0"
104+
- "--address=127.0.0.1"
96105
- "--port=5432"
106+
- "--health-check"
107+
- "--http-address=$(POD_IP)"
108+
- "--http-port=9040"
97109
- "--credentials-file"
98110
- "/opt/lsst/secrets/alloy-db/key.json"
99111
- {{ .Values.alloyDbProxy.config.instanceUri | quote }}
100-
readinessProbe:
101-
tcpSocket:
102-
port: 5432
103-
initialDelaySeconds: 2
112+
env:
113+
- name: POD_IP
114+
valueFrom:
115+
fieldRef:
116+
fieldPath: status.podIP
117+
startupProbe:
118+
httpGet:
119+
path: /readiness
120+
port: 9040
121+
failureThreshold: 20
104122
periodSeconds: 5
123+
readinessProbe:
124+
httpGet:
125+
path: /readiness
126+
port: 9040
127+
periodSeconds: 10
128+
timeoutSeconds: 3
129+
failureThreshold: 3
130+
livenessProbe:
131+
httpGet:
132+
path: /liveness
133+
port: 9040
134+
periodSeconds: 20
135+
timeoutSeconds: 5
136+
failureThreshold: 3
105137
resources:
106138
{{- toYaml .Values.alloyDbProxy.resources | nindent 12 }}
107139
securityContext:

0 commit comments

Comments
 (0)