Skip to content

Commit e578f93

Browse files
authored
fix: gracefulShutdown should be a factor of shutdownTimeout (#99)
* fix: gracefulShutdown should be a factor of shutdownTimeout * version
1 parent 37cba8b commit e578f93

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: pgdog
3-
version: v0.57
3+
version: v0.58
44
appVersion: "0.1.40"

examples/full-example.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ podDisruptionBudget:
8787
enabled: true
8888
minAvailable: 2 # Keep at least 2 pods running
8989

90-
# Configure graceful shutdown window. Should be larger than the sum of shutdownTimeout and preStopSleepSeconds
91-
terminationGracePeriodSeconds: 90
90+
# terminationGracePeriodSeconds is automatically set to shutdownTimeout + 5 seconds.
91+
# Uncomment to override:
92+
# terminationGracePeriodSeconds: 90
9293

9394
# Enable preStop sleep
9495
preStopSleepSeconds: 25

templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ spec:
4949
{{- end }}
5050
{{- if .Values.terminationGracePeriodSeconds }}
5151
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
52+
{{- else }}
53+
terminationGracePeriodSeconds: {{ add (div (default 60000 .Values.shutdownTimeout | int64) 1000) 5 }}
5254
{{- end }}
5355
{{- with .Values.extraInitContainers }}
5456
initContainers:

values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ replicas: 2
6666
# Not set by default; omitted from the pod spec unless explicitly specified.
6767
# Example: priorityClassName: production-critical
6868

69-
# Uncomment to enable explicit grace period
69+
# terminationGracePeriodSeconds is automatically set to shutdownTimeout + 5 seconds.
70+
# Default is 65 seconds (60s shutdownTimeout + 5s buffer).
71+
# Uncomment to override with an explicit value:
7072
# terminationGracePeriodSeconds: 90
7173

7274
# Optional: Delay stopping the container to allow the Kubernetes service to update its endpoints and

0 commit comments

Comments
 (0)