Skip to content

Conversation

@Dhouti
Copy link
Contributor

@Dhouti Dhouti commented Nov 5, 2025

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 tools and kmcp charts.

Copilot AI review requested due to automatic review settings November 5, 2025 05:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 affinity configuration 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>
@Dhouti Dhouti force-pushed the feature/helm-support-affinities branch from 585e10e to 80ad7cc Compare November 5, 2025 06:03
# -- 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/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# 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/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# 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/
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# 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/

Comment on lines +221 to +228
# -- 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: {}
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Comment on lines +43 to +50
# -- 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: {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these actually used anywhere? The templates seem to just check their namespaces values

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants