Make controller terminationGracePeriodSeconds configurable and align it with graceful shutdown timeout (#4556)

This commit is contained in:
Junya Okabe
2026-07-07 00:28:57 +02:00
committed by GitHub
parent 2ee6b3b8e8
commit e06294f5de
7 changed files with 39 additions and 15 deletions
@@ -40,7 +40,7 @@ spec:
-
{{- toYaml . | nindent 10 }}
{{- end }}
terminationGracePeriodSeconds: {{ default 10 (index $podSpec "terminationGracePeriodSeconds") }}
terminationGracePeriodSeconds: {{ default 35 (index $podSpec "terminationGracePeriodSeconds") }}
volumes:
- name: tmp
emptyDir: {}
@@ -36,6 +36,20 @@ tests:
path: spec.template.spec.dnsPolicy
value: "ClusterFirstWithHostNet"
- it: should allow overriding terminationGracePeriodSeconds via controller.pod
set:
controller:
pod:
spec:
terminationGracePeriodSeconds: 60
release:
name: "test-name"
namespace: "test-namespace"
asserts:
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 60
- it: should not allow overriding serviceAccountName via controller.pod
set:
controller:
@@ -25,3 +25,6 @@ tests:
- contains:
path: spec.template.spec.containers[0].command
content: "/manager"
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 35
@@ -96,7 +96,9 @@ controller:
affinity: {}
# Pod topology spread constraints.
topologySpreadConstraints: []
# Pod termination grace period (overrides default 10s).
# Pod termination grace period. Overrides the default of 35s, which must
# stay above the manager's graceful shutdown timeout (30s, controller-runtime's
# default) so in-flight reconciles can finish before the kubelet sends SIGKILL.
terminationGracePeriodSeconds: null
# Additional volumes appended to the default ones.
volumes: []