Add preStop lifecycle hook (#105)

* Add preStop lifecycle hook

* Fix typo in comment
This commit is contained in:
Jason O'Donnell 2019-11-06 11:06:57 -05:00 committed by GitHub
parent e3c771a467
commit a9e6a0a938
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -102,6 +102,14 @@ spec:
periodSeconds: 3 periodSeconds: 3
successThreshold: 1 successThreshold: 1
timeoutSeconds: 5 timeoutSeconds: 5
lifecycle:
# Vault container doesn't receive SIGTERM from Kubernetes
# and after the grace period ends, Kube sends SIGKILL. This
# causes issues with graceful shutdowns such as deregistering itself
# from Consul (zombie services).
preStop:
exec:
command: ["/bin/sh","-c","kill -SIGTERM $(pidof vault)"]
{{- if .Values.global.imagePullSecrets }} {{- if .Values.global.imagePullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- toYaml .Values.global.imagePullSecrets | nindent 8 }} {{- toYaml .Values.global.imagePullSecrets | nindent 8 }}