[CELEBORN-2446] Support topologySpreadConstraints for master and worker pods in Helm chart - #3831
Open
strelok89 wants to merge 1 commit into
Open
[CELEBORN-2446] Support topologySpreadConstraints for master and worker pods in Helm chart#3831strelok89 wants to merge 1 commit into
strelok89 wants to merge 1 commit into
Conversation
…er pods in Helm chart The Helm chart exposes nodeSelector, affinity, tolerations and priorityClass for both master and worker pods, but not topologySpreadConstraints. Setting the value is silently ignored: Helm accepts it and nothing is rendered on the StatefulSet. podAntiAffinity cannot substitute for a multi-AZ deployment, because it is one-or-none per topology domain and cannot express "N pods per zone". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author
|
@SteNicholas pinging you for review, its small change but have lots of value |
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.
What changes were proposed in this pull request?
Add support for
topologySpreadConstraintson Celeborn master and worker pods in the Helm chart:charts/celeborn/templates/master/statefulset.yamlandcharts/celeborn/templates/worker/statefulset.yaml— rendertopologySpreadConstraintsfrom the corresponding value, following the existing{{- with }}idiom already used fornodeSelector,affinityandtolerations.charts/celeborn/values.yaml— declaretopologySpreadConstraints: []for both roles.charts/celeborn/tests/{master,worker}/statefulset_test.yaml— unit tests covering both the unset (field absent) and set (field rendered) cases.Example usage:
Why are the changes needed?
The chart already exposes
nodeSelector,affinity,tolerationsandpriorityClassfor both master and worker pods, but nottopologySpreadConstraints. Setting the value today is silently ignored — Helm acceptsworker.topologySpreadConstraintswithout error and nothing is rendered on the StatefulSet, so the constraint simply does not exist.podAntiAffinity— which the chart defaults to, onkubernetes.io/hostname— cannot substitute for a multi-AZ deployment. Pod anti-affinity is one-or-none per topology domain: it can express "at most one pod per zone", but not "N pods per zone" or "spread evenly across zones within a bounded skew". That is whattopologySpreadConstraintsis for.This also lines up with item 8, "Enhanced K8S support", on the improvements schedule in
CONTRIBUTING.md.Does this PR resolve a correctness bug?
Does this PR introduce any user-facing change?
Two new chart values,
master.topologySpreadConstraintsandworker.topologySpreadConstraints, both defaulting to[]. When they are unset the rendered StatefulSet is unchanged, so this is purely additive.How was this patch tested?
helm unittest charts/celeborn --file "tests/**/*_test.yaml" --strict— all chart unit tests pass, including the four new cases. Reverting only the template hunks makes exactly those new assertions fail, confirming they exercise the change.helm lint charts/celeborn— passes.helm templatewith a zone-spread constraint set renderstopologySpreadConstraintson the worker StatefulSet;helm templatewith default values renders notopologySpreadConstraintskey anywhere.