diff --git a/.changes/unreleased/Fixed-20260815-190234.yaml b/.changes/unreleased/Fixed-20260815-190234.yaml new file mode 100644 index 000000000..062d431cb --- /dev/null +++ b/.changes/unreleased/Fixed-20260815-190234.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Render global.daemonsetsTolerations into kai-config +time: 2026-08-15T19:02:34.96721934+01:00 +custom: + Author: dttung2905 + Issue: "" diff --git a/deployments/kai-scheduler/templates/_helpers.tpl b/deployments/kai-scheduler/templates/_helpers.tpl index 6c73c6f22..b130ab517 100644 --- a/deployments/kai-scheduler/templates/_helpers.tpl +++ b/deployments/kai-scheduler/templates/_helpers.tpl @@ -87,6 +87,10 @@ spec: tolerations: {{- toYaml .Values.global.tolerations | nindent 6 }} {{- end }} + {{- if .Values.global.daemonsetsTolerations }} + daemonsetsTolerations: + {{- toYaml .Values.global.daemonsetsTolerations | nindent 6 }} + {{- end }} {{- if .Values.global.priorityClassName }} priorityClassName: {{ .Values.global.priorityClassName | quote }} {{- end }} diff --git a/deployments/kai-scheduler/tests/numa_placement_exporter_test.yaml b/deployments/kai-scheduler/tests/numa_placement_exporter_test.yaml index b0c12a44f..ae0024847 100644 --- a/deployments/kai-scheduler/tests/numa_placement_exporter_test.yaml +++ b/deployments/kai-scheduler/tests/numa_placement_exporter_test.yaml @@ -48,3 +48,45 @@ tests: - equal: path: spec.numaPlacementExporter.tolerations[0].operator value: Exists + + - it: should not render global.daemonsetsTolerations when the list is empty + asserts: + - notExists: + path: spec.global.daemonsetsTolerations + + - it: should render global.daemonsetsTolerations onto spec.global + set: + global.daemonsetsTolerations: + - key: nvidia.com/gpu + operator: Exists + effect: NoSchedule + asserts: + - equal: + path: spec.global.daemonsetsTolerations[0].key + value: nvidia.com/gpu + - equal: + path: spec.global.daemonsetsTolerations[0].operator + value: Exists + - equal: + path: spec.global.daemonsetsTolerations[0].effect + value: NoSchedule + + - it: should render global.daemonsetsTolerations independently of exporter tolerations + set: + global.daemonsetsTolerations: + - key: dedicated + operator: Equal + value: gpu + effect: NoSchedule + numaPlacementExporter.tolerations: + - operator: Exists + asserts: + - equal: + path: spec.global.daemonsetsTolerations[0].key + value: dedicated + - equal: + path: spec.global.daemonsetsTolerations[0].value + value: gpu + - equal: + path: spec.numaPlacementExporter.tolerations[0].operator + value: Exists diff --git a/deployments/kai-scheduler/values.yaml b/deployments/kai-scheduler/values.yaml index 969fc045f..94ea99abe 100644 --- a/deployments/kai-scheduler/values.yaml +++ b/deployments/kai-scheduler/values.yaml @@ -25,6 +25,9 @@ global: affinity: {} requireDefaultPodAntiAffinityTerm: false tolerations: [] + # Additional tolerations for cluster DaemonSets (e.g. NUMA placement exporter). + # Merged ahead of each DaemonSet's own tolerations by the operator. + daemonsetsTolerations: [] priorityClassName: "" namespaceLabelSelector: {} podLabelSelector: {}