From d37665fc020f6f6e510ce5dd1e7d64f9a53039a9 Mon Sep 17 00:00:00 2001 From: Juan Manuel SA Date: Thu, 22 Jan 2026 13:44:52 +0100 Subject: [PATCH] Add support for configurable terminationGracePeriodSeconds Allows users to configure the pod termination grace period to ensure graceful shutdown of SFTPGo instances, particularly useful when used with SFTPGO_GRACE_TIME environment variable. --- sftpgo/templates/deployment.yaml | 3 +++ sftpgo/values.yaml | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/sftpgo/templates/deployment.yaml b/sftpgo/templates/deployment.yaml index b931c82..314feb5 100644 --- a/sftpgo/templates/deployment.yaml +++ b/sftpgo/templates/deployment.yaml @@ -45,6 +45,9 @@ spec: hostNetwork: {{ .Values.hostNetwork }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if not (quote .Values.terminationGracePeriodSeconds | empty) }} + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- end }} {{- with .Values.initContainers }} initContainers: {{- toYaml . | nindent 8 }} diff --git a/sftpgo/values.yaml b/sftpgo/values.yaml index 1a582b2..afcf869 100644 --- a/sftpgo/values.yaml +++ b/sftpgo/values.yaml @@ -341,6 +341,12 @@ affinity: {} # Warning: The use of host network is [discouraged](https://kubernetes.io/docs/concepts/configuration/overview/#services). Make sure to use it only when absolutely necessary. hostNetwork: false +# -- Duration in seconds the pod needs to terminate gracefully. +# See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#lifecycle) for details. +# Should be set in conjunction with SFTPGO_GRACE_TIME environment variable. +# Expected value: number of seconds (int64). +terminationGracePeriodSeconds: null + topologySpreadConstraints: # -- Enable pod [Topology Spread Constraints](https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/). enabled: false