diff --git a/Chart.yaml b/Chart.yaml index 9335236..921729f 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 name: pgdog -version: v0.57 +version: v0.58 appVersion: "0.1.40" diff --git a/examples/full-example.yaml b/examples/full-example.yaml index e5320c4..4857c9e 100644 --- a/examples/full-example.yaml +++ b/examples/full-example.yaml @@ -87,8 +87,9 @@ podDisruptionBudget: enabled: true minAvailable: 2 # Keep at least 2 pods running -# Configure graceful shutdown window. Should be larger than the sum of shutdownTimeout and preStopSleepSeconds -terminationGracePeriodSeconds: 90 +# terminationGracePeriodSeconds is automatically set to shutdownTimeout + 5 seconds. +# Uncomment to override: +# terminationGracePeriodSeconds: 90 # Enable preStop sleep preStopSleepSeconds: 25 diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 200189e..d19c982 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -49,6 +49,8 @@ spec: {{- end }} {{- if .Values.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- else }} + terminationGracePeriodSeconds: {{ add (div (default 60000 .Values.shutdownTimeout | int64) 1000) 5 }} {{- end }} {{- with .Values.extraInitContainers }} initContainers: diff --git a/values.yaml b/values.yaml index ecc03b1..737b674 100644 --- a/values.yaml +++ b/values.yaml @@ -66,7 +66,9 @@ replicas: 2 # Not set by default; omitted from the pod spec unless explicitly specified. # Example: priorityClassName: production-critical -# Uncomment to enable explicit grace period +# terminationGracePeriodSeconds is automatically set to shutdownTimeout + 5 seconds. +# Default is 65 seconds (60s shutdownTimeout + 5s buffer). +# Uncomment to override with an explicit value: # terminationGracePeriodSeconds: 90 # Optional: Delay stopping the container to allow the Kubernetes service to update its endpoints and