Skip to content

Commit a865133

Browse files
authored
Merge pull request #28 from gaul/healthz-probes
Use /healthz HTTP probes and graceful termination settings
2 parents f821a24 + 1269336 commit a865133

3 files changed

Lines changed: 29 additions & 5 deletions

File tree

charts/s3proxy/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.3.0
18+
version: 0.4.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/s3proxy/templates/deployment.yaml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ spec:
3030
{{- toYaml . | nindent 8 }}
3131
{{- end }}
3232
serviceAccountName: {{ include "comet-common.names.serviceAccount" . }}
33+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
3334
securityContext:
3435
{{- toYaml .Values.podSecurityContext | nindent 8 }}
3536
initContainers:
@@ -160,24 +161,44 @@ spec:
160161
- name: {{ include "s3proxy.portName" . }}
161162
containerPort: {{ .Values.service.targetPort }}
162163
protocol: TCP
163-
# tcpSocket probes only check the TCP accept, so they work unchanged
164-
# against a TLS-only port (no handshake performed).
164+
# /healthz responds without authentication (S3Proxy >= 3.2.0),
165+
# distinguishing a serving proxy from one that merely accepts TCP.
166+
# The kubelet does not verify certificates for HTTPS probes, so a
167+
# self-signed keystore works when native TLS is enabled. S3Proxy
168+
# releases after 3.3.0 fail readiness while draining in-flight
169+
# requests on shutdown, removing terminating pods from Service
170+
# endpoints.
165171
livenessProbe:
166-
tcpSocket:
172+
httpGet:
173+
path: /healthz
167174
port: {{ include "s3proxy.portName" . }}
175+
{{- if .Values.config.tls.enabled }}
176+
scheme: HTTPS
177+
{{- end }}
168178
initialDelaySeconds: 30
169179
periodSeconds: 10
170180
timeoutSeconds: 5
171181
successThreshold: 1
172182
failureThreshold: 3
173183
readinessProbe:
174-
tcpSocket:
184+
httpGet:
185+
path: /healthz
175186
port: {{ include "s3proxy.portName" . }}
187+
{{- if .Values.config.tls.enabled }}
188+
scheme: HTTPS
189+
{{- end }}
176190
initialDelaySeconds: 10
177191
periodSeconds: 5
178192
timeoutSeconds: 3
179193
successThreshold: 1
180194
failureThreshold: 3
195+
lifecycle:
196+
# Endpoint removal propagates asynchronously; keep serving
197+
# briefly so late-routed connections do not land on a pod that
198+
# has already begun shutting down.
199+
preStop:
200+
exec:
201+
command: ["sleep", "5"]
181202
resources:
182203
{{- toYaml .Values.resources | nindent 12 }}
183204
volumeMounts:

charts/s3proxy/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ podSecurityContext: {}
4848
# -- Container security context
4949
securityContext: {}
5050

51+
# -- Pod termination grace period. Covers the 5s preStop sleep plus the in-flight request drain (up to 30s) that S3Proxy releases after 3.3.0 perform on SIGTERM.
52+
terminationGracePeriodSeconds: 40
53+
5154
service:
5255
# -- Kubernetes service type
5356
type: ClusterIP

0 commit comments

Comments
 (0)