From 80ad7ccd43e0c9eef954e260b05f41fb2b16a4b3 Mon Sep 17 00:00:00 2001 From: Dhouti Date: Tue, 4 Nov 2025 22:03:15 -0800 Subject: [PATCH] feature(helm): Add support for affinities Signed-off-by: Dhouti --- .../templates/controller-deployment.yaml | 4 ++++ helm/kagent/templates/ui-deployment.yaml | 4 ++++ helm/kagent/values.yaml | 18 ++++++++++++++++++ .../grafana-mcp/templates/deployment.yaml | 4 ++++ helm/tools/grafana-mcp/values.yaml | 2 ++ helm/tools/querydoc/templates/deployment.yaml | 4 ++++ helm/tools/querydoc/values.yaml | 2 ++ 7 files changed, 38 insertions(+) diff --git a/helm/kagent/templates/controller-deployment.yaml b/helm/kagent/templates/controller-deployment.yaml index 559abd51f..14f82b9d4 100644 --- a/helm/kagent/templates/controller-deployment.yaml +++ b/helm/kagent/templates/controller-deployment.yaml @@ -39,6 +39,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.controller.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: controller args: diff --git a/helm/kagent/templates/ui-deployment.yaml b/helm/kagent/templates/ui-deployment.yaml index 3b009a1e9..bd518ab51 100644 --- a/helm/kagent/templates/ui-deployment.yaml +++ b/helm/kagent/templates/ui-deployment.yaml @@ -34,6 +34,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.ui.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: ui securityContext: diff --git a/helm/kagent/values.yaml b/helm/kagent/values.yaml index aaf12dd5a..c31595343 100644 --- a/helm/kagent/values.yaml +++ b/helm/kagent/values.yaml @@ -46,6 +46,9 @@ 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: {} + # ============================================================================== # DATABASE CONFIGURATION # ============================================================================== @@ -85,6 +88,9 @@ controller: # -- 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: {} image: registry: "" @@ -136,6 +142,9 @@ ui: # -- 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: {} + # ============================================================================== # LLM PROVIDERS CONFIGURATION # ============================================================================== @@ -208,6 +217,15 @@ kagent-tools: memory: 1Gi tools: loglevel: "debug" + + # -- 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: {} # ============================================================================== # AGENTS diff --git a/helm/tools/grafana-mcp/templates/deployment.yaml b/helm/tools/grafana-mcp/templates/deployment.yaml index c4fd07469..9042ae9a5 100644 --- a/helm/tools/grafana-mcp/templates/deployment.yaml +++ b/helm/tools/grafana-mcp/templates/deployment.yaml @@ -27,6 +27,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: grafana-mcp securityContext: diff --git a/helm/tools/grafana-mcp/values.yaml b/helm/tools/grafana-mcp/values.yaml index c34bffb37..826651310 100644 --- a/helm/tools/grafana-mcp/values.yaml +++ b/helm/tools/grafana-mcp/values.yaml @@ -24,6 +24,8 @@ tolerations: [] nodeSelector: {} +affinity: {} + service: type: ClusterIP port: 8000 diff --git a/helm/tools/querydoc/templates/deployment.yaml b/helm/tools/querydoc/templates/deployment.yaml index fde1a70dd..5920b6506 100644 --- a/helm/tools/querydoc/templates/deployment.yaml +++ b/helm/tools/querydoc/templates/deployment.yaml @@ -29,6 +29,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: querydoc securityContext: diff --git a/helm/tools/querydoc/values.yaml b/helm/tools/querydoc/values.yaml index bc9dcb573..3dfe76341 100644 --- a/helm/tools/querydoc/values.yaml +++ b/helm/tools/querydoc/values.yaml @@ -20,6 +20,8 @@ tolerations: [] nodeSelector: {} +affinity: {} + service: type: ClusterIP port: 8080