From 49a7f1caaa61eab0d8d74710bdec094c9c991b45 Mon Sep 17 00:00:00 2001 From: Nic Date: Mon, 9 Feb 2026 18:01:42 +0800 Subject: [PATCH] chore: add terminationGracePeriodSeconds and workerShutdownTimeout Signed-off-by: Nic --- charts/gateway/Chart.yaml | 2 +- charts/gateway/README.md | 2 ++ charts/gateway/templates/_pod.tpl | 1 + charts/gateway/templates/configmap.yaml | 1 + charts/gateway/values.yaml | 4 ++++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/gateway/Chart.yaml b/charts/gateway/Chart.yaml index 9532918..8a39cf3 100644 --- a/charts/gateway/Chart.yaml +++ b/charts/gateway/Chart.yaml @@ -14,7 +14,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: 0.2.49 +version: 0.2.50 # 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/gateway/README.md b/charts/gateway/README.md index b0797bc..e28b9e8 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -130,6 +130,7 @@ The command removes all the Kubernetes components associated with the chart and | apisix.stream.luaSharedDict.plugin-limit-conn-stream | string | `"10m"` | | | apisix.stream.luaSharedDict.tars-stream | string | `"1m"` | | | apisix.stream.luaSharedDict.worker-events-stream | string | `"10m"` | | +| apisix.terminationGracePeriodSeconds | int | `30` | termination grace period for API7 Gateway pods | | apisix.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. | | apisix.tolerations | list | `[]` | List of node taints to tolerate | | apisix.topologySpreadConstraints | list | `[]` | Topology Spread Constraints for pod assignment https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ The value is evaluated as a template | @@ -220,6 +221,7 @@ The command removes all the Kubernetes components associated with the chart and | nginx.workerConnections | string | `"10620"` | | | nginx.workerProcesses | string | `"auto"` | | | nginx.workerRlimitNofile | string | `"20480"` | | +| nginx.workerShutdownTimeout | string | `"240s"` | | | pluginAttrs | object | `{}` | Set APISIX plugin attributes, see [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L376) for more details | | rbac.create | bool | `false` | | | serviceAccount.annotations | object | `{}` | | diff --git a/charts/gateway/templates/_pod.tpl b/charts/gateway/templates/_pod.tpl index 07c4bc4..b041e22 100644 --- a/charts/gateway/templates/_pod.tpl +++ b/charts/gateway/templates/_pod.tpl @@ -27,6 +27,7 @@ spec: securityContext: {{- . | toYaml | nindent 4 }} {{- end }} + terminationGracePeriodSeconds: {{ .Values.apisix.terminationGracePeriodSeconds }} {{- with .Values.apisix.priorityClassName }} priorityClassName: {{ . }} {{- end }} diff --git a/charts/gateway/templates/configmap.yaml b/charts/gateway/templates/configmap.yaml index f08866f..b1fa65f 100644 --- a/charts/gateway/templates/configmap.yaml +++ b/charts/gateway/templates/configmap.yaml @@ -165,6 +165,7 @@ data: worker_processes: "{{ .Values.nginx.workerProcesses }}" enable_cpu_affinity: {{ and true .Values.nginx.enableCPUAffinity }} worker_rlimit_nofile: {{ default "20480" .Values.nginx.workerRlimitNofile }} # the number of files a worker process can open, should be larger than worker_connections + worker_shutdown_timeout: "{{ .Values.nginx.workerShutdownTimeout }}" event: worker_connections: {{ default "10620" .Values.nginx.workerConnections }} {{- with .Values.nginx.envs }} diff --git a/charts/gateway/values.yaml b/charts/gateway/values.yaml index e726468..24bc96d 100644 --- a/charts/gateway/values.yaml +++ b/charts/gateway/values.yaml @@ -145,6 +145,9 @@ apisix: # -- kind is DaemonSet, replicaCount not become effective replicaCount: 1 + # -- termination grace period for API7 Gateway pods + terminationGracePeriodSeconds: 30 + # -- Set [priorityClassName](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#pod-priority) for API7 Gateway pods priorityClassName: "" # -- Annotations to add to each pod @@ -423,6 +426,7 @@ admin: nginx: workerRlimitNofile: "20480" + workerShutdownTimeout: "240s" workerConnections: "10620" workerProcesses: auto enableCPUAffinity: true