Skip to content

Let each team's KubernetesExecutor connect to its own cluster - #75251

Merged
o-nikolas merged 1 commit into
apache:mainfrom
aws-mwaa:ghaeli/kubernetes-executor-team-clusters
Oct 23, 2026
Merged

o-nikolas merged 1 commit into
apache:mainfrom
aws-mwaa:ghaeli/kubernetes-executor-team-clusters

Conversation

@seanghaeli

@seanghaeli seanghaeli commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

In multi-team mode, a team's KubernetesExecutor reads its pod settings from the team's config, but it still connects with the global [kubernetes_executor] settings, so every team ends up on the same cluster. The docs call this out today: "Teams share the cluster set in the global [aws_eks_executor] section". This PR reads the connection settings (in_cluster, config_file, cluster_context, verify_ssl, ssl_ca_cert, api_client_retry_configuration) from the team's config, passes team_name to a client_factory that accepts it, and lets a subclass like AwsEksExecutor set its client factory on the class, so a KubernetesExecutor next to it keeps its own client. It also adds --team to airflow kubernetes cleanup-pods, which connects the way the team's executor does (--executor picks one if the team has more than one) and refuses a namespace another team or the global executors also use. Teams that relied on the global connection settings now need to set them per team, which I noted in the changelog. I tested it with two teams on two real EKS clusters, and each team's pod now runs on its own cluster:

before: cluster A: team_a pod, team_b pod   cluster B: (none)
after:  cluster A: team_a pod               cluster B: team_b pod

closes: #74844

Docs

Connecting each team to its own cluster
New "Connecting each team to its own cluster" section on the KubernetesExecutor page, including the line on the TCP keepalive settings

Changelog note
Changelog note for teams that relied on the global connection settings

Config and CLI reference
Updated client_factory / async_client_factory descriptions in the config reference, and --team on airflow kubernetes cleanup-pods in the CLI reference (only the changed entries shown)


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Opus 5.5) following the guidelines

@boring-cyborg boring-cyborg Bot added area:providers kind:documentation provider:cncf-kubernetes Kubernetes (k8s) provider related issues labels Oct 20, 2026
@seanghaeli
seanghaeli marked this pull request as ready for review October 20, 2026 20:20
@seanghaeli

seanghaeli commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

re:support per-team kubernetes clusters for Kubernetes and EKS executors @o-nikolas @vincbeck

@seanghaeli
seanghaeli force-pushed the ghaeli/kubernetes-executor-team-clusters branch from 90af24c to c32134e Compare October 20, 2026 22:29
@seanghaeli
seanghaeli force-pushed the ghaeli/kubernetes-executor-team-clusters branch from c32134e to 7408841 Compare October 21, 2026 17:01

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's another follow up coming for the AwsEksExecutor to make make use of this right?

Otherwise just an addition to one of vincent's comments

@seanghaeli

Copy link
Copy Markdown
Contributor Author

@o-nikolas

There's another follow up coming for the AwsEksExecutor to make make use of this right?

Correct, wanted to split up the cncf and ampp sides into separate PRs

@seanghaeli
seanghaeli force-pushed the ghaeli/kubernetes-executor-team-clusters branch from 7408841 to da531f5 Compare October 23, 2026 07:01

@o-nikolas o-nikolas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just one small item, otherwise looks good!

In multi-team mode, a team's KubernetesExecutor read its pod settings from
the team's config, but connected to the cluster set in the global
[kubernetes_executor] section, so every team ran its pods on the same
cluster. A client_factory could be set per team, but it was called without
arguments, so it couldn't tell which team it was building a client for.

A KubernetesExecutor subclass that builds its own client, such as the
upcoming AwsEksExecutor, could only install its factory through
[kubernetes_executor] client_factory. A plain KubernetesExecutor in the
same scope then picked it up too and sent its pods to the subclass's
cluster.

airflow kubernetes cleanup-pods also only connected to the global cluster.
It now takes --team, like generate-dag-yaml, and connects the way the
team's executor does, with --executor to pick one when the team has more
than one. It refuses a namespace that another team's KubernetesExecutor, or
a global one, also uses, since it would delete their pods too.

closes: apache#74844
@seanghaeli
seanghaeli force-pushed the ghaeli/kubernetes-executor-team-clusters branch from da531f5 to 53d6bcb Compare October 23, 2026 16:50
@o-nikolas
o-nikolas merged commit 8aa1cf2 into apache:main Oct 23, 2026
98 checks passed
@o-nikolas
o-nikolas deleted the ghaeli/kubernetes-executor-team-clusters branch October 23, 2026 18:51
@shahar1 shahar1 mentioned this pull request Nov 4, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KubernetesExecutor: let each team connect to its own cluster

4 participants