From 5a7693cd62520edd25b0714684e50747512427db Mon Sep 17 00:00:00 2001 From: Scott Hussey Date: Sun, 25 Aug 2019 07:21:53 -0500 Subject: [PATCH] (postgres) Add override for termination period - Allow configuration of the termination grace period for the Patroni pod with a default of 180s to ensure the database has time to gracefully spin down, even on slow disk. Change-Id: I420cbd601bbffa50217b717bd4a636d48d324617 --- postgresql/templates/statefulset.yaml | 2 ++ postgresql/values.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/postgresql/templates/statefulset.yaml b/postgresql/templates/statefulset.yaml index 1ce8b94e9..07cd0c178 100644 --- a/postgresql/templates/statefulset.yaml +++ b/postgresql/templates/statefulset.yaml @@ -132,6 +132,8 @@ spec: {{ tuple $envAll "postgresql" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value }} + + terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.server.timeout | default "180" }} initContainers: {{ tuple $envAll "postgresql" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} - name: set-volume-perms diff --git a/postgresql/values.yaml b/postgresql/values.yaml index 6ee4381eb..2a60d486a 100644 --- a/postgresql/values.yaml +++ b/postgresql/values.yaml @@ -70,6 +70,8 @@ pod: termination_grace_period: prometheus_postgresql_exporter: timeout: 30 + server: + timeout: 180 resources: enabled: false server: