Repository navigation
Reduce K8s test resource usage with single-node Kind clusters - #73998
Open
aaron-y-chen wants to merge 2 commits into
Open
aaron-y-chen wants to merge 2 commits into
aaron-y-chen wants to merge 2 commits into
Conversation
aaron-y-chen
marked this pull request as ready for review
October 1, 2026 02:51
aaron-y-chen
requested review from
amoghrajesh,
ashb,
bugraoz93,
choo121600,
ephraimbuddy,
gopidesupavan,
jason810496,
jedcunningham,
jscheffl,
potiuk and
vatsrahul1001
as code owners
October 1, 2026 02:51
Andrushika
reviewed
Oct 2, 2026
aaron-y-chen
force-pushed
the
single-node-kind-k8s-tests-v2
branch
2 times, most recently
from
October 4, 2026 16:05
59445f5 to
fe90fb9
Compare
aaron-y-chen
force-pushed
the
single-node-kind-k8s-tests-v2
branch
2 times, most recently
from
October 10, 2026 02:32
8665e2d to
e5e00a2
Compare
aaron-y-chen
force-pushed
the
single-node-kind-k8s-tests-v2
branch
from
October 10, 2026 23:28
e5e00a2 to
c690c65
Compare
This branch has not been deployed
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.
Human Summary
Local Airflow development on K8s (
breeze k8s) is quite heavy on resources (CPU/memory). I found that our Kind clusters start two nodes where one is enough, and dropping the extra node noticeably reduces resource usage. This setup has been really useful for me.I have used it to develop #69613, #69945 and #72555, and to reproduce a scheduler crash while reviewing #70475. Everything has worked well so far.
Please let me know if I've missed anything, for example if there's a historical reason for the two-node setup that I'm not aware of. Thanks!
AI Summary
AI Summary
Why
The K8s test Kind clusters have used a control-plane + worker topology since the original Kind migration in 2019 (#5837), and it has never been revisited.
The second node adds no schedulable capacity:
NoSchedule.The second node still has a cost.
kind loadcopies the Airflow image and the pinned test images into every node, so the control-plane receives a ~1.8GB copy that nothing reads. Every cluster also has to provision and join the extra node.This PR switches the cluster to a single control-plane node, which is Kind's default layout. Kind removes the control-plane taint when a cluster has only one node, so the same pods run there instead.
No test coverage is lost. All workload pods already shared one node, so no test ever exercised cross-node scheduling.
Changes
kind-cluster-conf.yaml: drop the worker node.extraPortMappingsmoves to the control-plane.get_kubernetes_port_numbers(): the forwarded port was read from a hard-codednodes[1], which raisesIndexErroron the new config. The mapping is now looked up bycontainerPort, so the rendered configs of clusters created before this change keep working too.CI impact
Two CI runs make a same-base A/B comparison:
Both were built from the same
maincommit (4d56e6c93d) on the same runner type (ubuntu-22.04).Phase timings from the job logs (Python 3.10, K8s v1.30.13,
use-standard-naming=false). Each cell shows KubernetesExecutor / CeleryExecutor:kind create clusterkind loadAirflow imageThe cluster-creation difference is the worker join, which took ~17s. Test time is unchanged.
A wider baseline of successful jobs from 13 canary runs (2026-07-05 to 2026-07-11) gives the same picture:
K8S Systemjobs, theRun complete K8S testsstep ran below the baseline minimum. The sixth was within range.That is roughly 35–50s saved per K8s job. A canary run has 38 K8s jobs, about 475 job-minutes in total: 36
K8S Systemjobs,K8S Lang-SDKand the overlay smoke test. So this saves about 20–30 runner-minutes per canary run.K8s jobs are not on the PR critical path, so this change does not shorten PR feedback time. The larger gain is for local development, shown below.
Local benchmark
This was measured on the original branch: a single run on Apple-silicon macOS + Docker Desktop, with the same image on both sides, KubernetesExecutor, Python 3.10 and K8s v1.30.13.
upload-k8s-imagekind create cluster¹deploy-airflow¹ Measured with plain
kind create clusterand the node image cached on both sides, to isolate the effect of the topology.Validation
On this branch, rebased onto
mainat489316fbc7:uv run --project dev/breeze pytest dev/breeze/tests/test_kubernetes_utils.py -xvs: 3 passed.prek run --stage pre-commiton the changed files: passed.With the same code on #69459:
K8S Systemjobs,K8S Lang-SDKand the Kustomize overlay smoke test passed.breeze k8sflow (create / configure / upload / deploy / tests / delete):Notes for reviewers
full tests neededlabel would run the full K8s matrix (v1.30 to v1.35) on single-node clusters before merge.nodes[1]. Suppose you create a single-node cluster frommain, then check out a release branch in the same worktree.breeze k8son that branch fails withIndexError. Runningbreeze k8s create-cluster --force-recreate-clusterrecovers.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5.5) following the guidelines