Repository navigation
Conversation
Contributor
[Medium impact] The rules affect pod placement across several Retool Deployments in one chart. The PR appears safe to merge, with non-blocking improvements needed for empty overrides and tests. FindingsReviews (1) · Last reviewed commit: "[feat] Support topologySpreadConstraints..." · Reviewed by Greptile |
AdrienKuhn
approved these changes
Nov 10, 2026
…rs and code executor Add a top-level topologySpreadConstraints value, with per-component overrides that follow the existing affinity fallback order (worker -> parent -> global, or component -> global). A constraint without a labelSelector gets the selector labels of the pod's own component. One list can then spread each Deployment on its own pods, for example across zones, without a separate selector per component. The default is an empty list, so rendered manifests do not change unless the value is set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve the list by key presence instead of `default`: the most specific values block that sets topologySpreadConstraints wins, so an explicit [] disables constraints for that component while an unset key still inherits. Add .github/test_topology_spread_constraints.py with render assertions: each component selects only its own pods, an explicit labelSelector is kept, worker and parent overrides apply only where set, an empty override disables constraints, and the default renders none. The option fixture now uses an explicit selector that differs from the injected one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hema Follows the convention from tryretool#427: top-level keys without schema annotations are marked @Schema hidden, so they stay out of values.schema.json and README.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jrhuerta
force-pushed
the
topology-spread-constraints
branch
from
November 23, 2026 21:35
ee3202a to
829d716
Compare
Author
|
@mertbozfakioglu @tomgoren-retool could one of you take a look at this when you have a moment? I rebased it onto Thanks! |
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.
Summary
The chart exposes
affinity,nodeSelectorandtolerationsbut nottopologySpreadConstraints. Without them, there is no way to spread Retool replicas evenly across availability zones. On clusters with per-zone node pools (for example Karpenter), the scheduler keeps placing new replicas in the first zone that has room. Running pods are never rebalanced, so one zone fills up first.This PR adds
topologySpreadConstraintsto these Deployments:deployment_backend.yaml)deployment_workflows.yaml)_workers.tpl)deployment_code_executor.yaml)Values
topologySpreadConstraints: new top-level list, default[].<parent>.worker/agents.evalWorker, then<parent>, then globalworkflows, then globalcodeExecutor, then globalThe first block that sets the key wins. An explicit
[]therefore disables constraints for that component, and an unset key inherits from the next block. This useshasKeyrather thandefault, becausedefaultwould treat[]as unset.A constraint without a
labelSelectorgets the selector labels of the pod's own component, through theretool.topologySpreadConstraintshelper. One global list then spreads each Deployment over its own pods only:A constraint that sets its own
labelSelectoris rendered unchanged.Testing
New
.github/test_topology_spread_constraints.py, added to thelint-chartjob. It asserts that:spec.selector.matchLabels, and no two components share a selector;labelSelectoris kept as written (the code executor in the fixture);agents.evalWorker) applies to that worker only;agents) applies to both agent workers and not to the workflow worker;[]override disables constraints for that component only.I mutation-tested the assertions. Each of these changes makes at least one test fail:
defaultsemantics instead ofhasKey, the backend selector used for workers, and always overwritinglabelSelector.Also checked:
[],helm templateoutput is identical tomainforci/test-install-values.yamlmerged with each existingci/*-option.yamlfile. Only random generated secrets differ.helm lintpasses. Bothvalues.yamlcopies are in sync. The chart version is bumped to 6.14.3.schema/generate.sh --checkpasses; the new top-level key is marked@schema hiddenlike its neighbours.🤖 Generated with Claude Code