From ca74cc5bfc79bb83f4106788d5404cbe54003c3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BE=D1=81=D1=82=D0=BE=D0=B2=D0=BE=D0=B8=CC=86=20?= =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Wed, 9 Sep 2026 17:45:46 +0300 Subject: [PATCH] [flant] added nodeselector and tolerations --- .helm/templates/sts.yaml | 22 +++++----------------- .helm/values.yaml | 11 ++++++++--- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.helm/templates/sts.yaml b/.helm/templates/sts.yaml index a108dfa..60c664c 100644 --- a/.helm/templates/sts.yaml +++ b/.helm/templates/sts.yaml @@ -1,6 +1,3 @@ -{{- $gpuRole := .Values.gpu.nodeRoleKey }} -{{- $tolKey := .Values.gpu.tolerationKey }} -{{- $tolVal := .Values.gpu.tolerationValue }} --- apiVersion: apps/v1 kind: StatefulSet @@ -31,20 +28,11 @@ spec: app: {{ .Chart.Name }} topologyKey: kubernetes.io/hostname weight: 100 - {{- if $gpuRole }} - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: {{ $gpuRole | quote }} - operator: Exists - {{- end }} - {{- if and $tolKey $tolVal }} - tolerations: - - key: {{ $tolKey | quote }} - operator: Equal - value: {{ $tolVal | quote }} - effect: NoExecute + {{- if and .Values.gpu.enabled .Values.gpu.nodeSelector }} + nodeSelector: {{ toYaml .Values.gpu.nodeSelector | nindent 8 }} + {{- end }} + {{- if and .Values.gpu.enabled .Values.gpu.tolerations }} + tolerations: {{ toYaml .Values.gpu.tolerations | nindent 6 }} {{- end }} imagePullSecrets: - name: registrysecret diff --git a/.helm/values.yaml b/.helm/values.yaml index 139db74..23bffbc 100644 --- a/.helm/values.yaml +++ b/.helm/values.yaml @@ -17,9 +17,14 @@ env: TRANSFORMERS_OFFLINE: 1 gpu: - nodeRoleKey: node-role.deckhouse.io/worker - tolerationKey: dedicated - tolerationValue: "" + enabled: true + nodeSelector: + node-role.deckhouse.io/cuda-worker: "" + tolerations: + - key: dedicated.deckhouse.io + operator: Equal + value: cuda-worker + effect: NoExecute resources: _default: