From dd8b4e5cc744229bec455c59f340004bc24be1cf Mon Sep 17 00:00:00 2001 From: Henrik Schmidt Date: Thu, 21 Dec 2023 11:32:16 +0000 Subject: [PATCH] Fix: Add preStop hook to allow graceful network shutdown (#121) Adding a preStop sleep to allow other controllers to remove the pod from the network path. Without, there's a risk of breaking in-flight requests when the container is already stopped but the endpoints/endpointsSlice objects haven't been updated. Source: https://learnk8s.io/graceful-shutdown --- charts/qdrant/templates/statefulset.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/qdrant/templates/statefulset.yaml b/charts/qdrant/templates/statefulset.yaml index 4438b7b..71d3e7b 100644 --- a/charts/qdrant/templates/statefulset.yaml +++ b/charts/qdrant/templates/statefulset.yaml @@ -157,6 +157,10 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} + lifecycle: + preStop: + exec: + command: ["sleep", "3"] volumeMounts: - name: qdrant-storage mountPath: /qdrant/storage