This is an automated email from the ASF dual-hosted git repository.

nic-6443 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new ce37e9b  feat(apisix): make graceful shutdown settings configurable 
(#1012)
ce37e9b is described below

commit ce37e9b4bc06abf9869032d4632f5c9292319eb5
Author: Xiangyan Wang <[email protected]>
AuthorDate: Wed Sep 30 15:33:32 2026 +0800

    feat(apisix): make graceful shutdown settings configurable (#1012)
    
    Co-authored-by: Yann Wang <[email protected]>
---
 charts/apisix/Chart.yaml                |  2 +-
 charts/apisix/README.md                 |  2 ++
 charts/apisix/templates/deployment.yaml | 10 ++++------
 charts/apisix/values.yaml               | 11 +++++++++++
 4 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/charts/apisix/Chart.yaml b/charts/apisix/Chart.yaml
index 033c5bb..0702fdd 100644
--- a/charts/apisix/Chart.yaml
+++ b/charts/apisix/Chart.yaml
@@ -31,7 +31,7 @@ type: application
 # This is the chart version. This version number should be incremented each 
time you make changes
 # to the chart and its templates, including the app version.
 # Versions are expected to follow Semantic Versioning (https://semver.org/)
-version: 2.17.0
+version: 2.17.1
 
 # This is the version number of the application being deployed. This version 
number should be
 # incremented each time you make changes to the application. Versions are not 
expected to
diff --git a/charts/apisix/README.md b/charts/apisix/README.md
index bcf1a63..147bdef 100644
--- a/charts/apisix/README.md
+++ b/charts/apisix/README.md
@@ -260,6 +260,7 @@ The command removes all the Kubernetes components 
associated with the chart and
 | ingress.tls | list | `[]` | Ingress TLS settings |
 | initContainer.image | string | `"busybox"` | Init container image |
 | initContainer.tag | float | `1.28` | Init container tag |
+| lifecycle | object | `{"preStop":{"exec":{"command":["/bin/sh","-c","sleep 
30"]}}}` | Lifecycle hooks for the Apache APISIX container |
 | metrics | object | 
`{"serviceMonitor":{"annotations":{},"enabled":false,"interval":"15s","labels":{},"name":"","namespace":""}}`
 | Observability configuration. |
 | metrics.serviceMonitor.annotations | object | `{}` | @param 
serviceMonitor.annotations ServiceMonitor annotations |
 | metrics.serviceMonitor.enabled | bool | `false` | Enable or disable Apache 
APISIX serviceMonitor |
@@ -299,6 +300,7 @@ The command removes all the Kubernetes components 
associated with the chart and
 | serviceAccount.annotations | object | `{}` | Annotations to add to the 
ServiceAccount |
 | serviceAccount.create | bool | `false` | Whether a ServiceAccount should be 
created for the APISIX pods |
 | serviceAccount.name | string | `""` | Name of the ServiceAccount to use. If 
not set and create is true, a name is generated from the chart fullname |
+| terminationGracePeriodSeconds | int | `30` | Number of seconds Kubernetes 
waits for Apache APISIX to terminate gracefully |
 | timezone | string | `""` | timezone is the timezone where apisix uses. For 
example: "UTC" or "Asia/Shanghai" This value will be set on apisix container's 
environment variable TZ. You may need to set the timezone to be consistent with 
your local time zone, otherwise the apisix's logs may used to retrieve event 
maybe in wrong timezone. |
 | tolerations | list | `[]` | List of node taints to tolerate |
 | topologySpreadConstraints | list | `[]` | Topology Spread Constraints for 
pod assignment spread across your cluster among failure-domains ref: 
https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods
 |
diff --git a/charts/apisix/templates/deployment.yaml 
b/charts/apisix/templates/deployment.yaml
index b1985d1..368c744 100644
--- a/charts/apisix/templates/deployment.yaml
+++ b/charts/apisix/templates/deployment.yaml
@@ -58,6 +58,7 @@ spec:
       {{- with .Values.priorityClassName }}
       priorityClassName: {{ . }}
       {{- end }}
+      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds 
}}
       containers:
         {{- $useTraditionalYaml := and (eq .Values.apisix.deployment.role 
"traditional") (eq .Values.apisix.deployment.role_traditional.config_provider 
"yaml") }}
         - name: {{ .Chart.Name }}
@@ -182,13 +183,10 @@ spec:
             {{- end}}
             timeoutSeconds: 1
           {{- end }}
+          {{- with .Values.lifecycle }}
           lifecycle:
-            preStop:
-              exec:
-                command:
-                  - /bin/sh
-                  - -c
-                  - "sleep 30"
+            {{- toYaml . | nindent 12 }}
+          {{- end }}
           volumeMounts:
           {{- if eq .Values.apisix.deployment.mode "standalone" }}
             - mountPath: /apisix-config
diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml
index e79e050..7e7f493 100644
--- a/charts/apisix/values.yaml
+++ b/charts/apisix/values.yaml
@@ -43,6 +43,8 @@ podAnnotations: {}
 # -- Set the securityContext for Apache APISIX pods
 podSecurityContext: {}
   # fsGroup: 2000
+# -- Number of seconds Kubernetes waits for Apache APISIX to terminate 
gracefully
+terminationGracePeriodSeconds: 30
 # -- Set the securityContext for Apache APISIX container
 securityContext: {}
   # capabilities:
@@ -52,6 +54,15 @@ securityContext: {}
   # runAsNonRoot: true
   # runAsUser: 1000
 
+# -- Lifecycle hooks for the Apache APISIX container
+lifecycle:
+  preStop:
+    exec:
+      command:
+        - /bin/sh
+        - -c
+        - "sleep 30"
+
 # -- See https://kubernetes.io/docs/tasks/run-application/configure-pdb/ for 
more details
 podDisruptionBudget:
   # -- Enable or disable podDisruptionBudget

Reply via email to