Decide pod_template and image based on Coordinator for lang-SDK tasks on KubernetesExecutor#68713
Merged
jason810496 merged 4 commits intoJun 29, 2026
Conversation
1 task
155e90c to
01e1017
Compare
01e1017 to
25fd6bd
Compare
uranusjr
reviewed
Jun 29, 2026
…netesExecutor Add an optional pod_template_file to each [sdk] coordinators entry so a queue routed to a non-Python coordinator launches its worker pod from a coordinator-specific template (e.g. an image bundling the JVM for a Java coordinator). The KubernetesExecutor resolves the template by queue when the task's executor_config does not set one; a per-task executor_config template still wins.
25fd6bd to
5fd63dd
Compare
uranusjr
reviewed
Jun 29, 2026
uranusjr
reviewed
Jun 29, 2026
uranusjr
approved these changes
Jun 29, 2026
uranusjr
left a comment
Member
There was a problem hiding this comment.
A couple of minor coding style suggestions. LGTM
Make the coordinator pod-template resolution easier to read: a plain dict.get without a redundant None default, and a separate assignment instead of a walrus that wraps across three lines.
karenbraganz
pushed a commit
to karenbraganz/airflow
that referenced
this pull request
Jun 30, 2026
… on KubernetesExecutor (apache#68713)
14 tasks
jason810496
added a commit
that referenced
this pull request
Jul 7, 2026
… on KubernetesExecutor (#68713) (#69536) Co-authored-by: Jason(Zhe-You) Liu <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A queue routed to a non-Python coordinator (
[sdk] queue_to_coordinator) needs a worker pod whose image carries that runtime (e.g. the JVM for a Java coordinator), but the KubernetesExecutor had no way to pick a coordinator-specific pod template or base image short of settingexecutor_configon every task.What
KubernetesExecutor._coordinator_pod_template_file(readspod_template_filefromextra, import-guarded for 3.3+) and apply it with precedence overexecutor_configinexecute_async.pod_template_file-- applied with precedence over per-taskexecutor_config(a queue's coordinator carries the runtime requirement, so it must win). Python queues resolve toNoneand are unaffected.worker_container_repository+worker_container_tag-- compose a per-queue base image (both required), since the base image is never carried by a pod template. Plumbed throughKubernetesJob.kube_imageto the pod request.[sdk]config is logged and ignored rather than crashing the scheduler.Example Config to support Lang-SDK feature with KubernetesExecutor
AIRFLOW__SDK__COORDINATORS:{ "jdk-11": { "classpath": "airflow.sdk.coordinators.java.JavaCoordinator", "kwargs": {"java_executable": "/usr/lib/jvm/java-11-openjdk/bin/java", "jvm_args": ["-Xmx1024m"]}, "extra": { "pod_template_file": "/opt/airflow/pod_templates/java.yaml", "worker_container_repository": "myrepo/airflow-java", "worker_container_tag": "2.3.0" } }, "jdk-17": { "classpath": "airflow.sdk.coordinators.java.JavaCoordinator", "kwargs": {"java_executable": "/usr/lib/jvm/java-17-openjdk/bin/java", "jvm_args": ["-Xmx512m"]}, "extra": { "pod_template_file": "/opt/airflow/pod_templates/java.yaml", "worker_container_repository": "myrepo/airflow-java", "worker_container_tag": "3.3.0" } } }Next
Was generative AI tooling used to co-author this PR?