You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "aaron-y-chen (via GitHub)" <gi...@apache.org> on 2026/09/05 08:05:13 UTC

[PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

aaron-y-chen opened a new pull request, #72555:
URL: https://github.com/apache/airflow/pull/72555

   closes: #35154
   
   ## Summary
   - `worker-kerberos` becomes a Kubernetes native sidecar 
     - moved from `containers` to `initContainers` with a fixed `restartPolicy: Always` in both `worker-deployment.yaml` (Celery) and `pod-template-file.kubernetes-helm-yaml` (KubernetesExecutor).
   - As an ordinary container it never exits, and a task Pod (`restartPolicy: Never`) only completes once **all** app containers terminate. KubernetesExecutor Pods therefore never reach `Succeeded`: the task hangs and the Pod leaks.
   - The `klist -s` probe from #71221 could not fix this alone - an ordinary sidecar's probe gates only its own readiness, not the main containers.
   
   
   ## E2E Tests
   
   | | before (ordinary sidecar) | after (native sidecar) |
   | --- | --- | --- |
   | kerberos container started | `04:58:23Z` | `07:21:06Z` |
   | `base` container started | `04:58:22Z` | `07:22:05Z` |
   | startup relationship | parallel - `base` started 1s *earlier* | sequential - `base` waited 59s for the ticket |
   | `base` terminated | `Completed`, exit 0 | `Completed`, exit 0 |
   | sidecar after `base` exited | still running | terminated by kubelet within 5s |
   | Pod outcome | `Running`, unchanged for 24m37s | completed and removed within 10s |
   | leftover | `1/2 NotReady` | none |
   
   Before: the Dag run stayed `running` and the Pod had to be deleted by hand.
   After: two independent Dag runs both reached `success` with every task Pod cleaned up, and `TestKubernetesExecutor::test_integration_run_dag` passes.
   The ticket wait differed between the two runs (59s and 20s), so the gap is real ticket acquisition rather than a fixed delay.
   
   Celery worker on the same cluster: `restartPolicy=Always`, startup probe preserved as `["klist","-s"]`, absent from `spec.containers`, `started=true`, and `klist -s` exits 0 inside the sidecar.
   
   This scenario is not covered by CI - `k8s-tests.yml` never enables `kerberosSidecar`, and the kerberos overlay smoke test only checks the KDC and keytab. Helm render tests for both templates are included and run in CI.
   
   ## Compatibility
   
   `significant` newsfragment included. `SidecarContainers` is enabled by default since Kubernetes 1.29 and GA in 1.33; the chart already requires 1.30+. Anything querying `.spec.containers[name=worker-kerberos]` must move to `.spec.initContainers` and `.status.initContainerStatuses`.
   
   `kerberosInitContainer` is deliberately left untouched - it is a one-shot `airflow kerberos -o` mode with different semantics, and deprecating it is a separate public-values decision.
   
   
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, please
   change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
   -->
   
   - [x] Yes (please specify the tool below)
   
   Generated-by: [Claude Opus 5] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4109691974


##########
chart/values.schema.json:
##########
@@ -1793,7 +1793,13 @@
                             "default": [],
                             "items": {
                                 "type": "object",
-                                "additionalProperties": {}
+                                "additionalProperties": {},
+                                "properties": {
+                                    "kerberosInitContainer": {
+                                        "description": "Removed in chart 2.0.0. Configure `kerberosSidecar` instead and enable its `startupProbe` to wait for the initial Kerberos ticket.",
+                                        "not": {}
+                                    }
+                                }

Review Comment:
   Done. With the current schema, Helm accepts leftover `kerberosInitContainer` values, but the chart ignores them. Do you think we should include a chart newsfragment explaining its removal and the migration to `kerberosSidecar`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4113186150


##########
chart/newsfragments/72555.significant.rst:
##########
@@ -0,0 +1,18 @@
+Kerberos worker sidecars now run as Kubernetes native sidecars

Review Comment:
   Okay I made it more precise. It looks better now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4111427054


##########
chart/values.schema.json:
##########
@@ -1793,7 +1793,13 @@
                             "default": [],
                             "items": {
                                 "type": "object",
-                                "additionalProperties": {}
+                                "additionalProperties": {},
+                                "properties": {
+                                    "kerberosInitContainer": {
+                                        "description": "Removed in chart 2.0.0. Configure `kerberosSidecar` instead and enable its `startupProbe` to wait for the initial Kerberos ticket.",
+                                        "not": {}
+                                    }
+                                }

Review Comment:
   Feel free to add it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r3986215541


##########
chart/templates/workers/worker-deployment.yaml:
##########
@@ -262,6 +262,61 @@ spec:
         {{- if .Values.workers.celery.extraInitContainers }}
           {{- tpl (toYaml .Values.workers.celery.extraInitContainers) . | nindent 8 }}
         {{- end }}
+        {{- if .Values.workers.celery.kerberosSidecar.enabled }}

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub) via commits" <co...@airflow.apache.org>.
aaron-y-chen commented on PR #72555:
URL: https://github.com/apache/airflow/pull/72555#issuecomment-6592283515

   Hi @Miretpl, welcome back! I'd appreciate it if you could review this PR again, as I've hit the five-PR limit and want to make room for a new one 😂


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4058315944


##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1293,6 +1296,80 @@ def test_runtime_class_name_values_are_configurable(self):
 
         assert jmespath.search("spec.runtimeClassName", docs[0]) == "nvidia"
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert jmespath.search("spec.containers[?name=='worker-kerberos'] | [0]", docs[0]) is None
+
+    @pytest.mark.parametrize(
+        ("sidecar_enabled", "probe_enabled", "expected_names"),
+        [
+            (False, True, []),
+            (True, True, ["worker-kerberos"]),
+            (True, False, ["worker-kerberos"]),
+        ],
+    )
+    def test_kerberos_initialization(self, sidecar_enabled, probe_enabled, expected_names):
+        docs = render_chart(
+            values={
+                "workers": {
+                    "kubernetes": {
+                        "kerberosSidecar": {
+                            "enabled": sidecar_enabled,
+                            "startupProbe": {"enabled": probe_enabled},
+                        },
+                    }
+                }
+            },
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        assert (jmespath.search("spec.initContainers[].name", docs[0]) or []) == expected_names
+        assert (
+            jmespath.search('metadata.annotations."checksum/kerberos-keytab"', docs[0]) is not None
+        ) == sidecar_enabled
+        if sidecar_enabled:
+            sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+            assert sidecar["args"] == ["kerberos"]
+            assert sidecar["restartPolicy"] == "Always"
+            assert ("startupProbe" in sidecar) == probe_enabled
+
+    def test_pod_override_reconciliation_with_kerberos_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        base_pod = PodGenerator.deserialize_model_dict(docs[0])

Review Comment:
   I added this to verify that the native sidecar survives KubernetesExecutor pod override reconciliation. However, this exercises existing `PodGenerator` behavior rather than chart rendering, so I removed the test and kept the chart tests focused on the rendered Pod.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "github-actions[bot] (via GitHub) via commits" <co...@airflow.apache.org>.
github-actions[bot] commented on PR #72555:
URL: https://github.com/apache/airflow/pull/72555#issuecomment-6610040479

   <!-- fork-ci-gate: {"gate_checked": true, "sha": "e6d3bb0ec6d8788b882b9f026a4a65240bbf08a0", "since": "2026-11-03T16:47:26.847344+00:00", "state": "running"} -->
   
   **Fork CI: running.** CI for the latest commit is running in your fork.
   
   Pull requests from contributors run their CI in the contributor's own fork. GitHub Actions is free and has no minute limit on public forks, while the CI capacity of the Apache Software Foundation is shared by every ASF project and is finite.
   
   Latest run: https://github.com/aaron-y-chen/airflow/actions/runs/41673558469
   
   How this works: [fork CI for external contributors](https://github.com/apache/airflow/blob/main/dev/breeze/doc/ci/08_fork_ci_for_external_contributors.md).
   
   ---
   _This comment was posted automatically by the fork CI monitor from templates drafted with an AI-assisted tool, so it may contain mistakes. An Apache Airflow maintainer, a real person, will review the pull request once its fork CI is green. [Why the first pass is automated](https://github.com/apache/airflow/blob/main/contributing-docs/25_maintainer_pr_triage.md#why-the-first-pass-is-automated)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4109423037


##########
chart/tests/helm_tests/security/test_kerberos.py:
##########
@@ -36,6 +36,19 @@ def test_kerberos_not_mentioned_in_render_if_disabled(self):
         k8s_objects_to_consider_str = json.dumps(k8s_objects_to_consider)
         assert k8s_objects_to_consider_str.count("kerberos") == 1
 
+    @pytest.mark.parametrize("init_values", [{"enabled": True}, {"enabled": False}, {}])
+    @pytest.mark.parametrize(
+        ("worker_type", "worker_set"),
+        [("celery", False), ("kubernetes", False), ("celery", True)],
+    )
+    def test_removed_kerberos_init_container_settings(self, init_values, worker_type, worker_set):
+        worker_values = {"kerberosInitContainer": init_values}
+        if worker_set:
+            worker_values = {"enableDefault": False, "sets": [{"name": "test", **worker_values}]}
+
+        with pytest.raises(HelmFailedError, match=r"kerberosInitContainer': 'not' failed"):
+            render_chart(values={"workers": {worker_type: worker_values}})

Review Comment:
   Done, it's clearer now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4109908650


##########
chart/values.schema.json:
##########
@@ -2112,6 +2118,10 @@
                                 }
                             }
                         },
+                        "kerberosInitContainer": {

Review Comment:
   Done. I removed the `kerberosInitContainer` schema entries for both Celery and Kubernetes workers, including the `not: {}` checks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r3994108643


##########
chart/files/pod-template-file.kubernetes-helm-yaml:
##########
@@ -101,6 +101,62 @@ spec:
         {{- include "custom_airflow_environment" . | indent 6 }}
         {{- include "standard_airflow_environment" . | indent 6 }}
     {{- end }}
+    {{- if .Values.workers.kubernetes.kerberosSidecar.enabled }}

Review Comment:
   Do we really need `kerberosInitContainer` when we have native sidecars?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r3986200294


##########
chart/files/pod-template-file.kubernetes-helm-yaml:
##########
@@ -101,6 +101,62 @@ spec:
         {{- include "custom_airflow_environment" . | indent 6 }}
         {{- include "standard_airflow_environment" . | indent 6 }}
     {{- end }}
+    {{- if .Values.workers.kubernetes.kerberosSidecar.enabled }}

Review Comment:
   Done. I added a conditional statement at the `kerberosInitContainer` step to prevent duplicate work.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4041444233


##########
chart/files/pod-template-file.kubernetes-helm-yaml:
##########
@@ -101,6 +101,62 @@ spec:
         {{- include "custom_airflow_environment" . | indent 6 }}
         {{- include "standard_airflow_environment" . | indent 6 }}
     {{- end }}
+    {{- if .Values.workers.kubernetes.kerberosSidecar.enabled }}

Review Comment:
   Main is Helm Chart 2.0 - we can break stuff here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4052038915


##########
chart/values.schema.json:
##########
@@ -2123,7 +2123,7 @@
                                     "default": false
                                 },
                                 "startupProbe": {
-                                    "description": "Startup probe for the Kerberos worker sidecar (runs `klist -s`).",
+                                    "description": "Wait for a valid Kerberos ticket before starting worker or task containers (runs `klist -s`). Disabling this probe allows them to start before a ticket is available.",

Review Comment:
   Thanks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4041450793


##########
chart/files/pod-template-file.kubernetes-helm-yaml:
##########
@@ -101,6 +101,62 @@ spec:
         {{- include "custom_airflow_environment" . | indent 6 }}
         {{- include "standard_airflow_environment" . | indent 6 }}
     {{- end }}
+    {{- if .Values.workers.kubernetes.kerberosSidecar.enabled }}

Review Comment:
   Of course, we will need the respective change regarding, e.g. communication for a 1.2x line regarding that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4053774938


##########
chart/templates/_helpers.yaml:
##########
@@ -1127,15 +1127,10 @@ Usage:
 {{- end }}
 
 {{/*
-Custom merge function which enables full map overwrite and `or` logic for boolean overwrite.

Review Comment:
   I see. It's indeed out of scope for this PR. I think it's worth having a follow-up PR since this doc is a bit outdated, but let me revert it first.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4054720074


##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1293,6 +1296,80 @@ def test_runtime_class_name_values_are_configurable(self):
 
         assert jmespath.search("spec.runtimeClassName", docs[0]) == "nvidia"
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert jmespath.search("spec.containers[?name=='worker-kerberos'] | [0]", docs[0]) is None
+
+    @pytest.mark.parametrize(
+        ("sidecar_enabled", "probe_enabled", "expected_names"),
+        [
+            (False, True, []),
+            (True, True, ["worker-kerberos"]),
+            (True, False, ["worker-kerberos"]),
+        ],
+    )
+    def test_kerberos_initialization(self, sidecar_enabled, probe_enabled, expected_names):

Review Comment:
   Nice suggestion! I've already applied it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4112405236


##########
chart/newsfragments/72555.significant.rst:
##########
@@ -0,0 +1,18 @@
+Kerberos worker sidecars now run as Kubernetes native sidecars

Review Comment:
   There are duplications in this newsfragment and assumptions about the setups which we do not know are always true, so we can miss something. It would be better to keep communication simple and include only information about what is changing and how it is changing. Everything else is potentially deployment-dependent.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on PR #72555:
URL: https://github.com/apache/airflow/pull/72555#issuecomment-5848377559

   Done, let me know if there's anything that can be improved :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on PR #72555:
URL: https://github.com/apache/airflow/pull/72555#issuecomment-5737888502

   Sorry about that. I pushed it before I got on a plane and forgot to request a review while waiting for the CI results 😅
   
   Thanks for the reviews! Let me check them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r3985993743


##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1293,6 +1296,68 @@ def test_runtime_class_name_values_are_configurable(self):
 
         assert jmespath.search("spec.runtimeClassName", docs[0]) == "nvidia"
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert jmespath.search("spec.containers[?name=='worker-kerberos'] | [0]", docs[0]) is None
+
+    def test_kerberos_init_and_sidecar_coexistence(self):
+        docs = render_chart(
+            values={
+                "workers": {
+                    "kubernetes": {
+                        "kerberosInitContainer": {"enabled": True},
+                        "kerberosSidecar": {"enabled": True},
+                    }
+                }
+            },
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        init_containers = jmespath.search("spec.initContainers", docs[0])
+        init_names = [c["name"] for c in init_containers]
+        assert "kerberos-init" in init_names
+        assert "worker-kerberos" in init_names
+        assert init_names.index("kerberos-init") < init_names.index("worker-kerberos")
+        assert init_containers[-1]["name"] == "worker-kerberos"
+
+        kerberos_init = jmespath.search("spec.initContainers[?name=='kerberos-init'] | [0]", docs[0])
+        worker_kerberos = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert "restartPolicy" not in kerberos_init
+        assert worker_kerberos.get("restartPolicy") == "Always"
+
+    def test_pod_override_reconciliation_with_kerberos_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        base_pod = PodGenerator.deserialize_model_dict(docs[0])
+        override_pod = k8s.V1Pod(
+            spec=k8s.V1PodSpec(
+                containers=[
+                    k8s.V1Container(name="base"),
+                    k8s.V1Container(name="custom-container", image="custom-image:latest"),
+                ]
+            )
+        )
+        reconciled = PodGenerator.reconcile_pods(base_pod, override_pod)
+
+        sidecars = [c for c in reconciled.spec.init_containers if c.name == "worker-kerberos"]
+        assert len(sidecars) == 1
+        assert sidecars[0].restart_policy == "Always"
+
+        custom_containers = [c for c in reconciled.spec.containers if c.name == "custom-container"]
+        assert len(custom_containers) == 1
+        assert custom_containers[0].image == "custom-image:latest"
+        assert custom_containers[0].args is None

Review Comment:
   Fixed! Thanks for pointing it out.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4098779070


##########
chart/tests/helm_tests/security/test_kerberos.py:
##########
@@ -36,6 +36,19 @@ def test_kerberos_not_mentioned_in_render_if_disabled(self):
         k8s_objects_to_consider_str = json.dumps(k8s_objects_to_consider)
         assert k8s_objects_to_consider_str.count("kerberos") == 1
 
+    @pytest.mark.parametrize("init_values", [{"enabled": True}, {"enabled": False}, {}])
+    @pytest.mark.parametrize(
+        ("worker_type", "worker_set"),
+        [("celery", False), ("kubernetes", False), ("celery", True)],
+    )
+    def test_removed_kerberos_init_container_settings(self, init_values, worker_type, worker_set):
+        worker_values = {"kerberosInitContainer": init_values}
+        if worker_set:
+            worker_values = {"enableDefault": False, "sets": [{"name": "test", **worker_values}]}
+
+        with pytest.raises(HelmFailedError, match=r"kerberosInitContainer': 'not' failed"):
+            render_chart(values={"workers": {worker_type: worker_values}})

Review Comment:
   I would separate it a bit for default behaviour and by the worker-set value. It should simplify the test cases itself a bit.



##########
chart/values.schema.json:
##########
@@ -2112,6 +2118,10 @@
                                 }
                             }
                         },
+                        "kerberosInitContainer": {

Review Comment:
   Is removing the existing one not enough? 🤔



##########
chart/values.schema.json:
##########
@@ -1793,7 +1793,13 @@
                             "default": [],
                             "items": {
                                 "type": "object",
-                                "additionalProperties": {}
+                                "additionalProperties": {},
+                                "properties": {
+                                    "kerberosInitContainer": {
+                                        "description": "Removed in chart 2.0.0. Configure `kerberosSidecar` instead and enable its `startupProbe` to wait for the initial Kerberos ticket.",
+                                        "not": {}
+                                    }
+                                }

Review Comment:
   I would remove that from the worker set. There is a missing validation part for the whole worker set configuration at the schema level, but this is something which I need to figure out how I would like to have it done, and before that, I would prefare to maintain the status quo for now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on PR #72555:
URL: https://github.com/apache/airflow/pull/72555#issuecomment-6069157508

   Thanks for all the reviews! I believe this version is much better than before :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub) via commits" <co...@airflow.apache.org>.
Miretpl merged PR #72555:
URL: https://github.com/apache/airflow/pull/72555


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r3972867371


##########
chart/files/pod-template-file.kubernetes-helm-yaml:
##########
@@ -101,6 +101,62 @@ spec:
         {{- include "custom_airflow_environment" . | indent 6 }}
         {{- include "standard_airflow_environment" . | indent 6 }}
     {{- end }}
+    {{- if .Values.workers.kubernetes.kerberosSidecar.enabled }}

Review Comment:
   We have `kerberos-init`, and with that addition, we have duplication of work. We should have only one Kerberos init container, which will keep running as sidecar after first successful run (startup probe will run successfully).



##########
chart/templates/workers/worker-deployment.yaml:
##########
@@ -262,6 +262,61 @@ spec:
         {{- if .Values.workers.celery.extraInitContainers }}
           {{- tpl (toYaml .Values.workers.celery.extraInitContainers) . | nindent 8 }}
         {{- end }}
+        {{- if .Values.workers.celery.kerberosSidecar.enabled }}

Review Comment:
   Same as the comment above.



##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1293,6 +1296,68 @@ def test_runtime_class_name_values_are_configurable(self):
 
         assert jmespath.search("spec.runtimeClassName", docs[0]) == "nvidia"
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert jmespath.search("spec.containers[?name=='worker-kerberos'] | [0]", docs[0]) is None
+
+    def test_kerberos_init_and_sidecar_coexistence(self):
+        docs = render_chart(
+            values={
+                "workers": {
+                    "kubernetes": {
+                        "kerberosInitContainer": {"enabled": True},
+                        "kerberosSidecar": {"enabled": True},
+                    }
+                }
+            },
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        init_containers = jmespath.search("spec.initContainers", docs[0])
+        init_names = [c["name"] for c in init_containers]
+        assert "kerberos-init" in init_names
+        assert "worker-kerberos" in init_names
+        assert init_names.index("kerberos-init") < init_names.index("worker-kerberos")
+        assert init_containers[-1]["name"] == "worker-kerberos"
+
+        kerberos_init = jmespath.search("spec.initContainers[?name=='kerberos-init'] | [0]", docs[0])
+        worker_kerberos = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert "restartPolicy" not in kerberos_init
+        assert worker_kerberos.get("restartPolicy") == "Always"
+
+    def test_pod_override_reconciliation_with_kerberos_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        base_pod = PodGenerator.deserialize_model_dict(docs[0])
+        override_pod = k8s.V1Pod(
+            spec=k8s.V1PodSpec(
+                containers=[
+                    k8s.V1Container(name="base"),
+                    k8s.V1Container(name="custom-container", image="custom-image:latest"),
+                ]
+            )
+        )
+        reconciled = PodGenerator.reconcile_pods(base_pod, override_pod)
+
+        sidecars = [c for c in reconciled.spec.init_containers if c.name == "worker-kerberos"]
+        assert len(sidecars) == 1
+        assert sidecars[0].restart_policy == "Always"
+
+        custom_containers = [c for c in reconciled.spec.containers if c.name == "custom-container"]
+        assert len(custom_containers) == 1
+        assert custom_containers[0].image == "custom-image:latest"
+        assert custom_containers[0].args is None

Review Comment:
   In all other test cases, when we have a similar need, we just use jmspath. Could you adjust it?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4004112631


##########
chart/files/pod-template-file.kubernetes-helm-yaml:
##########
@@ -101,6 +101,62 @@ spec:
         {{- include "custom_airflow_environment" . | indent 6 }}
         {{- include "standard_airflow_environment" . | indent 6 }}
     {{- end }}
+    {{- if .Values.workers.kubernetes.kerberosSidecar.enabled }}

Review Comment:
   At first, I kept `kerberosInitContainer` because I was worried about breaking users who still use the old settings. But after thinking about it again, I agree that we probably don't need it with native sidecars. Let me remove it, handle the old settings properly, and verify both startup probe cases before pushing the changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4055275555


##########
chart/templates/NOTES.txt:
##########
@@ -150,3 +150,15 @@ https://airflow.apache.org/docs/helm-chart/stable/production-guide.html#api-secr
 {{- if ne .Values.executor (tpl .Values.config.core.executor $) }}
    {{ fail "Please configure the executor with `executor`, not `config.core.executor`." }}
 {{- end }}
+

Review Comment:
   Done. On main, the removed values are now rejected by values.schema.json. The corresponding warning for the Chart 1.2.x line is in #73390.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on PR #72555:
URL: https://github.com/apache/airflow/pull/72555#issuecomment-5753245688

   Thanks for the review again! Let me know if there's anything I can improve 😄


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "aaron-y-chen (via GitHub)" <gi...@apache.org>.
aaron-y-chen commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4052399641


##########
chart/tests/helm_tests/security/test_kerberos.py:
##########
@@ -60,6 +76,64 @@ def test_kerberos_envs_available_in_worker_with_persistence(self):
             "spec.template.spec.containers[0].env", docs[0]
         )
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={
+                "executor": "CeleryExecutor",
+                "workers": {"celery": {"kerberosSidecar": {"enabled": True}}},
+            },
+            show_only=["templates/workers/worker-deployment.yaml"],
+        )
+        sidecar = jmespath.search(
+            "spec.template.spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0]
+        )
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert (

Review Comment:
   Done, I also remove the similar pattern in `test_pod_template_file.py` and `test_worker_sets.py` as well.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Run Kerberos worker sidecars as Kubernetes native sidecars [airflow]

Posted by "Miretpl (via GitHub)" <gi...@apache.org>.
Miretpl commented on code in PR #72555:
URL: https://github.com/apache/airflow/pull/72555#discussion_r4041471447


##########
chart/templates/_helpers.yaml:
##########
@@ -1127,15 +1127,10 @@ Usage:
 {{- end }}
 
 {{/*
-Custom merge function which enables full map overwrite and `or` logic for boolean overwrite.

Review Comment:
   That's a bit of an unrelated change.



##########
chart/templates/NOTES.txt:
##########
@@ -150,3 +150,15 @@ https://airflow.apache.org/docs/helm-chart/stable/production-guide.html#api-secr
 {{- if ne .Values.executor (tpl .Values.config.core.executor $) }}
    {{ fail "Please configure the executor with `executor`, not `config.core.executor`." }}
 {{- end }}
+

Review Comment:
   Rather for 1.2x line as a warning than a hard fail. On main, it will be sufficient to have a proper values.schema.json file to handle that.



##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1293,6 +1296,80 @@ def test_runtime_class_name_values_are_configurable(self):
 
         assert jmespath.search("spec.runtimeClassName", docs[0]) == "nvidia"
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert jmespath.search("spec.containers[?name=='worker-kerberos'] | [0]", docs[0]) is None
+
+    @pytest.mark.parametrize(
+        ("sidecar_enabled", "probe_enabled", "expected_names"),
+        [
+            (False, True, []),
+            (True, True, ["worker-kerberos"]),
+            (True, False, ["worker-kerberos"]),
+        ],
+    )
+    def test_kerberos_initialization(self, sidecar_enabled, probe_enabled, expected_names):

Review Comment:
   I would separate this test case per `sidecar_enabled` flag. It will simplify the logic a bit.



##########
chart/tests/helm_tests/security/test_kerberos.py:
##########
@@ -60,6 +76,64 @@ def test_kerberos_envs_available_in_worker_with_persistence(self):
             "spec.template.spec.containers[0].env", docs[0]
         )
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={
+                "executor": "CeleryExecutor",
+                "workers": {"celery": {"kerberosSidecar": {"enabled": True}}},
+            },
+            show_only=["templates/workers/worker-deployment.yaml"],
+        )
+        sidecar = jmespath.search(
+            "spec.template.spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0]
+        )
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert (

Review Comment:
   This verification is rather not needed.



##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1421,10 +1501,10 @@ def test_kerberos_sidecar_startup_probe(self, override, expected):
             chart_dir=self.temp_chart_dir,
         )
 
-        assert (
-            jmespath.search("spec.containers[?name=='worker-kerberos'] | [0].startupProbe", docs[0])
-            == expected
-        )
+        sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert sidecar is not None
+        assert sidecar.get("restartPolicy") == "Always"
+        assert sidecar.get("startupProbe") == expected

Review Comment:
   ```suggestion
           assert sidecar["restartPolicy"] == "Always"
           assert sidecar["startupProbe"] == expected
   ```
   I find `KeyError` message clearer than `None == Always`, but maybe that is opinionaited a bit 🤔



##########
chart/values.yaml:
##########
@@ -844,37 +844,16 @@ workers:
       # Container level lifecycle hooks
       containerLifecycleHooks: {}
 
-      # Startup probe for the kerberos sidecar: `klist -s` succeeds once the credential
-      # cache holds a valid, unexpired ticket. Disable for custom images without `klist`.
+      # Wait for a valid Kerberos ticket before starting worker or task containers.

Review Comment:
   Similar change as in `values.schema.json` file.



##########
chart/values.schema.json:
##########
@@ -2123,7 +2123,7 @@
                                     "default": false
                                 },
                                 "startupProbe": {
-                                    "description": "Startup probe for the Kerberos worker sidecar (runs `klist -s`).",
+                                    "description": "Wait for a valid Kerberos ticket before starting worker or task containers (runs `klist -s`). Disabling this probe allows them to start before a ticket is available.",

Review Comment:
   ```suggestion
                                       "description": "Wait for a valid Kerberos ticket before starting the Airflow Celery worker (runs `klist -s`). Disabling this probe allows them to start before a ticket is available.",
   ```



##########
chart/tests/helm_tests/airflow_aux/test_pod_template_file.py:
##########
@@ -1293,6 +1296,80 @@ def test_runtime_class_name_values_are_configurable(self):
 
         assert jmespath.search("spec.runtimeClassName", docs[0]) == "nvidia"
 
+    def test_kerberos_sidecar_is_native_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+        assert sidecar is not None
+        assert sidecar["restartPolicy"] == "Always"
+        assert jmespath.search("spec.containers[?name=='worker-kerberos'] | [0]", docs[0]) is None
+
+    @pytest.mark.parametrize(
+        ("sidecar_enabled", "probe_enabled", "expected_names"),
+        [
+            (False, True, []),
+            (True, True, ["worker-kerberos"]),
+            (True, False, ["worker-kerberos"]),
+        ],
+    )
+    def test_kerberos_initialization(self, sidecar_enabled, probe_enabled, expected_names):
+        docs = render_chart(
+            values={
+                "workers": {
+                    "kubernetes": {
+                        "kerberosSidecar": {
+                            "enabled": sidecar_enabled,
+                            "startupProbe": {"enabled": probe_enabled},
+                        },
+                    }
+                }
+            },
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        assert (jmespath.search("spec.initContainers[].name", docs[0]) or []) == expected_names
+        assert (
+            jmespath.search('metadata.annotations."checksum/kerberos-keytab"', docs[0]) is not None
+        ) == sidecar_enabled
+        if sidecar_enabled:
+            sidecar = jmespath.search("spec.initContainers[?name=='worker-kerberos'] | [0]", docs[0])
+            assert sidecar["args"] == ["kerberos"]
+            assert sidecar["restartPolicy"] == "Always"
+            assert ("startupProbe" in sidecar) == probe_enabled
+
+    def test_pod_override_reconciliation_with_kerberos_sidecar(self):
+        docs = render_chart(
+            values={"workers": {"kubernetes": {"kerberosSidecar": {"enabled": True}}}},
+            show_only=["templates/pod-template-file.yaml"],
+            chart_dir=self.temp_chart_dir,
+        )
+        base_pod = PodGenerator.deserialize_model_dict(docs[0])

Review Comment:
   Why that way?



##########
chart/values.schema.json:
##########
@@ -2915,7 +2832,7 @@
                                     "default": false
                                 },
                                 "startupProbe": {
-                                    "description": "Startup probe for the Kerberos worker sidecar (runs `klist -s`).",
+                                    "description": "Wait for a valid Kerberos ticket before starting worker or task containers (runs `klist -s`). Disabling this probe allows them to start before a ticket is available.",

Review Comment:
   ```suggestion
                                       "description": "Wait for a valid Kerberos ticket before starting pod-template-file base container (runs `klist -s`). Disabling this probe allows them to start before a ticket is available.",
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org