orchestrator-kubernetes: suppress minDomains when availability_zones is set#36516
Open
jubrad wants to merge 3 commits into
Open
orchestrator-kubernetes: suppress minDomains when availability_zones is set#36516jubrad wants to merge 3 commits into
jubrad wants to merge 3 commits into
Conversation
…is set When `availability_zones` pins pods to specific AZs via node affinity, the number of eligible topology domains is constrained. If `minDomains` exceeds the number of pinned zones, Kubernetes treats the global minimum as 0, and with `maxSkew=1` only one pod can be scheduled — leaving additional replicas stuck pending. Fix by suppressing `minDomains` in the topology spread constraint whenever `availability_zones` is set, matching the existing behavior for soft spread constraints. Fixes CLO-74 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extract topology_spread_min_domains helper and add unit test covering the four suppression cases: soft spread, az-pinned, both, and neither. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
When
availability_zonespins pods to specific AZs via node affinity,minDomainswas still being applied to the topology spread constraint.minDomainstells the scheduler "there must be at least N eligible topology domains." IfminDomainsexceeds the number of pinned zones, Kubernetes treats the global minimum as 0 — and withmaxSkew=1, only one pod can be scheduled at a time, leaving additional replicas stuck pending indefinitely.Fixes CLO-74.
Solution
Suppress
minDomainsin theTopologySpreadConstraintwhenavailability_zonesis set, mirroring the existing behavior for soft spread constraints. A warning is logged whenmin_domainsis configured but will be ignored.Testing
See follow-up commit for unit test.