Skip to content

Conversation

@brouberol
Copy link
Contributor

If a task was created by a custom executor_options['pod_template_file'] option, we make sure to render the TaskInstance's associated k8s_pod_spec with this specific pod_template_file, to avoid seeing discrepancies between the spec visible in airflow and the one deployed to Kubernetes.

After having deployed this patch to my test instance running in our Kubernetes cluster, the 2 fields that were missing from the K8s Pod Spec pane were now visible (namely, the kubeapi_enabled label in the following screenshot).

Screenshot 2025-02-03 at 12 43 40

closes: #46373


@boring-cyborg boring-cyborg bot added area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Feb 3, 2025
@brouberol brouberol force-pushed the issue-46373 branch 3 times, most recently from 562f04f to 01bb5ab Compare February 3, 2025 14:42
@brouberol brouberol changed the title Render a pod spec using the pod_template_file override, if passed to the executor Render a pod spec using the pod_template_file override, if passed to the executor Feb 3, 2025
@brouberol brouberol force-pushed the issue-46373 branch 2 times, most recently from 8d34bab to 1f71b35 Compare February 3, 2025 15:16
Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good to me but I'd love others (@hussein-awala ?) to take a look?

Copy link
Contributor

@nevcohen nevcohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about updating the documentation? Like in pod_override here.

@brouberol brouberol force-pushed the issue-46373 branch 3 times, most recently from dba7c1d to b3ba3ef Compare February 7, 2025 16:43
@brouberol
Copy link
Contributor Author

What about updating the documentation? Like in pod_override here.

The documentation is actually quite good there! I did add a mention related to the non default pod_template_file being used to render the K8s Pod Spec though. Thanks for the suggestion!

…the executor

If a task was created by a custom `executor_options['pod_template_file']` option,
we make sure to render the `TaskInstance`'s associated `k8s_pod_spec`
with this specific `pod_template_file`, to avoid seeing discrepancies
between the spec visible in airflow and the one deployed to Kubernetes.

Signed-off-by: Balthazar Rouberol <brouberol@wikimedia.org>
@eladkal eladkal merged commit 1b668c3 into apache:main Feb 9, 2025
71 checks passed
vargacypher pushed a commit to vargacypher/airflow that referenced this pull request Feb 9, 2025
…sed to the executor (apache#46374)

If a task was created by a custom `executor_options['pod_template_file']` option,
we make sure to render the `TaskInstance`'s associated `k8s_pod_spec`
with this specific `pod_template_file`, to avoid seeing discrepancies
between the spec visible in airflow and the one deployed to Kubernetes.

Signed-off-by: Balthazar Rouberol <brouberol@wikimedia.org>
@brouberol brouberol deleted the issue-46373 branch February 10, 2025 10:05
ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
…sed to the executor (apache#46374)

If a task was created by a custom `executor_options['pod_template_file']` option,
we make sure to render the `TaskInstance`'s associated `k8s_pod_spec`
with this specific `pod_template_file`, to avoid seeing discrepancies
between the spec visible in airflow and the one deployed to Kubernetes.

Signed-off-by: Balthazar Rouberol <brouberol@wikimedia.org>
wmfgerrit pushed a commit to wikimedia/operations-deployment-charts that referenced this pull request Mar 17, 2025
This will give us the k8s pod spec fix we sent in
apache/airflow#46374.

Signed-off-by: Balthazar Rouberol <brouberol@wikimedia.org>
Bug: T388378
Change-Id: I97f66eb0ac879a5bbdb297730e11f8fc66a094a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:cncf-kubernetes Kubernetes (k8s) provider related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task k8s pod spec is rendered using the default pod_template_file, even when an override was passed to the KubernetesExecutor

4 participants