nguyenb2306632-cmyk opened a new pull request, #77076:
URL: https://github.com/apache/airflow/pull/77076

   Document what `executor_config` accepts for KubernetesExecutor and where the 
kubeconfig is set, in response to #46293.
   
   The issue asks to template `config_file` inside 
`executor_config["KubernetesExecutor"]`. On `main` that legacy format is no 
longer supported: `PodGenerator.from_obj` raises a `TypeError` for it, and 
`executor_config` only takes `pod_override` and `pod_template_file`. The docs 
didn't say this, and didn't point to the supported ways to target a different 
cluster.
   
   This adds a short "Choosing the cluster for a task" section to 
`kubernetes_executor.rst`:
   
   - `executor_config` accepts `pod_override` and `pod_template_file`, not a 
kubeconfig, and the legacy format raises a `TypeError`.
   - The executor's own kubeconfig comes from `[kubernetes_executor]` 
(`config_file`, `cluster_context`) or, per team, from the existing multi-team 
section, which the new text links to.
   - For a single task that must talk to another cluster, use 
`KubernetesPodOperator`, whose `config_file` argument is a templated field.
   
   This is a docs-only change and does not add a feature. I used `related:` 
instead of `closes:` because I asked on the issue which approach maintainers 
prefer. Happy to adjust or drop this PR if a different direction is preferred.
   
   Checks I ran (Ubuntu 22.04, Python 3.12, provider installed from PyPI):
   
   - Before the change the section is absent; after the change it is present 
and renders correctly (screenshots below).
   - A small script against the real provider code printed: 
`from_obj({"KubernetesExecutor": {...}})` raises `TypeError`; 
`from_obj({"pod_override": V1Pod(...)})` is accepted; `"config_file"` is in 
`KubernetesPodOperator.template_fields`, and `"{{ params.kubeconfig }}"` 
renders to `/tmp/prod.yaml`.
   - `prek run --from-ref upstream/main`:<img width="975" height="182" 
alt="image" 
src="https://github.com/user-attachments/assets/3a919b08-27bb-4e49-a9dd-0863ce1d55ec";
 />
   <img width="975" height="616" alt="image" 
src="https://github.com/user-attachments/assets/5007590a-c76a-457c-a999-382d72c0158b";
 />
   
   
   **This is a docx file containing images showing the process:** 
   [apache 
airflow.docx](https://github.com/user-attachments/files/34834391/apache.airflow.docx)
   
   
   related: #46293
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (Claude)
   
   Generated-by: Claude 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

  • [PR] Document how to choose t... nguyenb2306632-cmyk (via GitHub) via commits

Reply via email to