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

Miretpl pushed a commit to branch chart/v1-2x-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/chart/v1-2x-test by this push:
     new 08dcb6d00a1 [chart/v1-2x-test] Helm: Allow configuring 
terminationGracePeriodSeconds on the API server (#77284) (#77354)
08dcb6d00a1 is described below

commit 08dcb6d00a115a173ea576bd11164ee64e9e9210
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Nov 23 23:09:35 2026 +0000

    [chart/v1-2x-test] Helm: Allow configuring terminationGracePeriodSeconds on 
the API server (#77284) (#77354)
    
    Operators had no way to give the API server more time to drain in-flight
    requests on shutdown or rollout, unlike the other long-running components
    in the chart. Keeping the Kubernetes default leaves existing deployments
    unaffected.
    
    Revives the closed apache/airflow#56096, with the schema entry and tests
    requested in its review.
    
    Claude-Session: https://claude.ai/code/session_01UMsqrDCViJ3zyXmaN3T9vm
    (cherry picked from commit 3badaa6ae1d75c9e9544560662e5388c8293d7cc)
    
    Co-authored-by: Pranay Yelugam <[email protected]>
    Co-authored-by: Przemysław Mirowski 
<[email protected]>
---
 chart/templates/api-server/api-server-deployment.yaml     |  1 +
 chart/values.schema.json                                  |  5 +++++
 chart/values.yaml                                         |  3 +++
 .../tests/helm_tests/airflow_core/test_api_server.py      | 15 +++++++++++++++
 4 files changed, 24 insertions(+)

diff --git a/chart/templates/api-server/api-server-deployment.yaml 
b/chart/templates/api-server/api-server-deployment.yaml
index 0f115cc4cbd..99d5ef8d5b2 100644
--- a/chart/templates/api-server/api-server-deployment.yaml
+++ b/chart/templates/api-server/api-server-deployment.yaml
@@ -130,6 +130,7 @@ spec:
       tolerations: {{- toYaml $tolerations | nindent 8 }}
       topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | 
nindent 8 }}
       restartPolicy: Always
+      terminationGracePeriodSeconds: {{ 
.Values.apiServer.terminationGracePeriodSeconds }}
       {{- if $securityContext }}
       securityContext: {{ $securityContext | nindent 8 }}
       {{- end }}
diff --git a/chart/values.schema.json b/chart/values.schema.json
index e4a8420ef64..058c9410547 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -7656,6 +7656,11 @@
                     ],
                     "$ref": 
"#/definitions/io.k8s.api.core.v1.ResourceRequirements"
                 },
+                "terminationGracePeriodSeconds": {
+                    "description": "Grace period for API server to finish 
after SIGTERM is sent from Kubernetes.",
+                    "type": "integer",
+                    "default": 30
+                },
                 "apiServerConfig": {
                     "description": "This string (templated) will be mounted 
into the Airflow API Server as a custom `webserver_config.py`. You can bake a 
`webserver_config.py` in to your image instead or specify a configmap 
containing the webserver_config.py.",
                     "type": [
diff --git a/chart/values.yaml b/chart/values.yaml
index 8b52143243a..a69521312b6 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -2533,6 +2533,9 @@ apiServer:
   #   cpu: 100m
   #   memory: 128Mi
 
+  # Grace period for API server to finish after SIGTERM is sent from Kubernetes
+  terminationGracePeriodSeconds: 30
+
   # Add custom annotations to the `apiServer` ConfigMap
   configMapAnnotations: {}
 
diff --git a/helm-tests/tests/helm_tests/airflow_core/test_api_server.py 
b/helm-tests/tests/helm_tests/airflow_core/test_api_server.py
index b8769976b83..fd07d042b17 100644
--- a/helm-tests/tests/helm_tests/airflow_core/test_api_server.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_api_server.py
@@ -256,6 +256,21 @@ class TestAPIServerDeployment:
         assert "test_label" in 
jmespath.search("spec.template.metadata.labels", docs[0])
         assert jmespath.search("spec.template.metadata.labels", 
docs[0])["test_label"] == "test_label_value"
 
+    @pytest.mark.parametrize(
+        ("api_server_values", "expected"),
+        [
+            ({}, 30),
+            ({"apiServer": {"terminationGracePeriodSeconds": 1200}}, 1200),
+        ],
+    )
+    def test_termination_grace_period_seconds(self, api_server_values, 
expected):
+        docs = render_chart(
+            values=api_server_values,
+            show_only=["templates/api-server/api-server-deployment.yaml"],
+        )
+
+        assert 
jmespath.search("spec.template.spec.terminationGracePeriodSeconds", docs[0]) == 
expected
+
     def test_should_create_valid_affinity_tolerations_and_node_selector(self):
         docs = render_chart(
             values={

Reply via email to