Skip to content

feat: add topologySpreadConstraints support to helm chart#1041

Open
kimsehwan96 wants to merge 2 commits into
kubernetes-sigs:mainfrom
kimsehwan96:feat/helm-topology-spread-constraints
Open

feat: add topologySpreadConstraints support to helm chart#1041
kimsehwan96 wants to merge 2 commits into
kubernetes-sigs:mainfrom
kimsehwan96:feat/helm-topology-spread-constraints

Conversation

@kimsehwan96

@kimsehwan96 kimsehwan96 commented Jun 26, 2026

Copy link
Copy Markdown

What this PR does / why we need it:

Adds an optional topologySpreadConstraints value to the controller Deployment, rendered only when set. Lets operators spread controller replicas across nodes/zones for availability when running with replicaCount > 1.
Mirrors the existing affinity/nodeSelector/tolerations pattern; no behavior change when unset.

Which issue(s) this PR is related to:

Release Note

Add `topologySpreadConstraints` value to the Helm chart for spreading the controller pods across topology domains.

Summary by CodeRabbit

  • New Features
    • Added support for configuring Kubernetes topology spread constraints for controller pod placement.
    • Introduced a new Helm values option (topologySpreadConstraints, default []) to control how pods are distributed across topology domains.
  • Documentation
    • Updated the Helm chart README configuration reference to include the new topologySpreadConstraints parameter and an example.
Copilot AI review requested due to automatic review settings June 26, 2026 06:12
@netlify

netlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit 1bc513c
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/6a42f4970122520008a89aa6
@kubernetes-prow kubernetes-prow Bot requested review from barney-s and soltysh June 26, 2026 06:12
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kimsehwan96
Once this PR has been reviewed and has the lgtm label, please assign barney-s for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow

Copy link
Copy Markdown

Welcome @kimsehwan96!

It looks like this is your first PR to kubernetes-sigs/agent-sandbox 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/agent-sandbox has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 26, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @kimsehwan96. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d3a86be0-f827-4e06-98fe-54eb261321da

📥 Commits

Reviewing files that changed from the base of the PR and between c1e8be1 and 1bc513c.

📒 Files selected for processing (1)
  • helm/values.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • helm/values.yaml

📝 Walkthrough

Walkthrough

Helm chart adds a controller topologySpreadConstraints value, documents it in the README, and conditionally renders it into the Deployment pod spec.

Changes

Helm topology spread constraints

Layer / File(s) Summary
Value and README updates
helm/values.yaml, helm/README.md
topologySpreadConstraints is added with an empty-list default, explanatory comments, and a README table entry.
Deployment rendering
helm/templates/deployment.yaml
The controller Deployment conditionally renders topologySpreadConstraints into the pod template spec from .Values.topologySpreadConstraints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

૮ᘏᗢ I hop through charts with tidy glee,
Topology spread helps pods roam free.
A value blooms, the docs agree,
The Deployment follows naturally.
Hoppy clusters, wheee!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding topologySpreadConstraints support to the Helm chart.
Description check ✅ Passed The description matches the template well, covering purpose and release note, with only the issue link section left unfilled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds Helm chart support for configuring topologySpreadConstraints on the controller Deployment PodSpec, enabling operators to spread controller replicas across topology domains (e.g., nodes/zones) for improved availability when replicaCount > 1, while keeping behavior unchanged when the value is unset/empty.

Changes:

  • Add a new topologySpreadConstraints value to values.yaml (default []).
  • Render spec.template.spec.topologySpreadConstraints in the controller Deployment only when provided.
  • Document the new value in the chart README parameter table.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
helm/values.yaml Introduces topologySpreadConstraints with inline examples/comments.
helm/templates/deployment.yaml Conditionally renders topologySpreadConstraints into the controller PodSpec.
helm/README.md Adds the new value to the chart configuration table.
Comment thread helm/values.yaml Outdated
@janetkuo janetkuo added action-required: resolve-copilot-comments ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 27, 2026
@aditya-shantanu

Copy link
Copy Markdown
Collaborator

/lgtm

@kubernetes-prow kubernetes-prow Bot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jun 29, 2026
@kubernetes-prow

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread helm/values.yaml
Comment thread helm/values.yaml Outdated
Signed-off-by: kimsehwan96 <sktpghks138@gmail.com>
@kimsehwan96 kimsehwan96 force-pushed the feat/helm-topology-spread-constraints branch from c1e8be1 to 1bc513c Compare June 29, 2026 22:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. ready-for-review size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

4 participants