feature(helm): Add support for affinities for main deployments#1086
feature(helm): Add support for affinities for main deployments#1086Dhouti wants to merge 1 commit intokagent-dev:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds affinity configuration support to multiple Helm charts, enabling users to configure pod affinity rules for better workload placement control in Kubernetes deployments.
- Adds
affinityconfiguration fields to values files for querydoc, grafana-mcp, and kagent charts - Implements affinity settings in corresponding deployment templates
- Provides consistent configuration options across different chart components
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| helm/tools/querydoc/values.yaml | Adds affinity configuration field with empty default |
| helm/tools/querydoc/templates/deployment.yaml | Implements affinity template block in pod spec |
| helm/tools/grafana-mcp/values.yaml | Adds affinity configuration field with empty default |
| helm/tools/grafana-mcp/templates/deployment.yaml | Implements affinity template block in pod spec |
| helm/kagent/values.yaml | Adds affinity configuration fields for root, controller, ui, and kagent-tools components with documentation comments |
| helm/kagent/templates/ui-deployment.yaml | Implements affinity template block for ui component |
| helm/kagent/templates/controller-deployment.yaml | Implements affinity template block for controller component |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Dhouti <l.rex.via@gmail.com>
585e10e to
80ad7cc
Compare
| # -- Node labels to match for `Pod` [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). | ||
| nodeSelector: {} | ||
|
|
||
| # Affintities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ |
There was a problem hiding this comment.
| # Affintities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ | |
| # Affinities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ |
| # -- Node labels to match for `Pod` [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). | ||
| nodeSelector: {} | ||
|
|
||
| # Affintities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ |
There was a problem hiding this comment.
| # Affintities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ | |
| # Affinities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ |
| # -- Node labels to match for `Pod` [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). | ||
| nodeSelector: {} | ||
|
|
||
| # Affintities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ |
There was a problem hiding this comment.
| # Affintities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ | |
| # Affinities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ |
| # -- Node taints which will be tolerated for `Pod` [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). | ||
| tolerations: [] | ||
|
|
||
| # -- Node labels to match for `Pod` [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). | ||
| nodeSelector: {} | ||
|
|
||
| # Affintities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ | ||
| affinity: {} |
There was a problem hiding this comment.
In order for these to take effect you'll have to update the helm chart for the tools in https://github.com/kagent-dev/tools
| # -- Node taints which will be tolerated for `Pod` [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). | ||
| tolerations: [] | ||
|
|
||
| # -- Node labels to match for `Pod` [scheduling](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/). | ||
| nodeSelector: {} | ||
|
|
||
| # Affinities for `Pod` https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/ | ||
| affinity: {} |
There was a problem hiding this comment.
Are these actually used anywhere? The templates seem to just check their namespaces values
Helm charts do not currently support
affinity.This PR adds basic support for scheduling the main workloads with affinities.
This is sometimes an ideal choice over
nodeSelector.Ideally these would also be added to the
toolsandkmcpcharts.