Repository navigation
feat(helm): add affinity and topologySpreadConstraints on Kagent controller and ui - #2365
Merged
EItanya merged 1 commit intoJul 31, 2026
Merged
Conversation
anthonyhaussman
marked this pull request as ready for review
July 30, 2026 16:38
Contributor
There was a problem hiding this comment.
Pull request overview
Adds per-component pod scheduling configuration to the Helm chart so operators can apply Kubernetes affinity and topologySpreadConstraints to the Kagent controller and UI Deployments for more advanced placement and resiliency.
Changes:
- Exposes
controller.affinity/controller.topologySpreadConstraintsandui.affinity/ui.topologySpreadConstraintsinvalues.yaml. - Renders those values into the controller and UI Deployment pod specs only when non-empty.
- Adds Helm unit tests to validate rendering behavior (set vs. default not rendered) for both components.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| helm/kagent/values.yaml | Adds new user-facing values for controller/UI affinity and topology spread constraints. |
| helm/kagent/templates/ui-deployment.yaml | Conditionally renders affinity and topologySpreadConstraints into the UI pod spec. |
| helm/kagent/templates/controller-deployment.yaml | Conditionally renders affinity and topologySpreadConstraints into the controller pod spec. |
| helm/kagent/tests/ui-deployment_test.yaml | Adds unit tests covering UI affinity/topologySpreadConstraints rendering and defaults. |
| helm/kagent/tests/controller-deployment_test.yaml | Adds unit tests covering controller affinity/topologySpreadConstraints rendering and defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Support affinity and topology spread constraints on controller and ui deployments for advanced scheduling. Assisted-by: GLM 5.2 Signed-off-by: Anthony Hausman <[email protected]>
EItanya
approved these changes
Jul 31, 2026
EItanya
left a comment
Contributor
There was a problem hiding this comment.
LGTM, you will need to backport to get into v0.10.x
Contributor
Author
EItanya
pushed a commit
that referenced
this pull request
Aug 3, 2026
#2365 Signed-off-by: Anthony Hausman <[email protected]>
3 tasks done
EItanya
pushed a commit
that referenced
this pull request
Aug 25, 2026
## Summary
- The `controller` and `ui` deployments expose `nodeSelector`,
`tolerations` and
`affinity`, but the bundled PostgreSQL Deployment rendered by
`templates/postgresql.yaml` has no scheduling fields at all
- This makes the bundled database impossible to place. On a cluster with
a
dedicated, tainted node pool it cannot follow the rest of the control
plane, and
a single-replica PVC-backed database left on an autoscaled pool gets
drained
whenever that pool scales in — taking the controller down with it
- Adds `nodeSelector`, `tolerations` and `affinity` to
`database.postgres.bundled`, rendered with the same `{{- with }}` form
and in the
same order `controller-deployment.yaml` already uses
- Values documentation copies the wording already used by the
`controller` and
`ui` blocks, so the three read consistently
- Defaults stay empty, so rendered output is unchanged for existing
installs
Follows the same shape as #2213 (`nodeSelector`/`tolerations` for the
`kagent-tools` subchart) and #2365
(`affinity`/`topologySpreadConstraints` for
controller and ui), which closed the equivalent gap for other
components.
## Test plan
- [x] `helm unittest helm/kagent` passes — 274 tests, including 4 new
ones in
`tests/postgresql_test.yaml` covering the unset, `nodeSelector`,
`tolerations`
and `affinity` cases
- [x] `helm template` with `database.postgres.bundled.nodeSelector` and
`tolerations` set renders both fields on the `kagent-postgresql`
Deployment pod
spec
- [x] `helm template` with the values unset renders no scheduling fields
on that
pod spec, confirming existing installs are unaffected
Signed-off-by: Carlos Landeras <[email protected]>
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.
Adds support for setting
affinityandtopologySpreadConstraintson thecontrolleranduideployments viavalues.yaml. This allows for more advanced scheduling of these components.