[flant] added nodeselector and tolerations

This commit is contained in:
Мостовой Владимир Андреевич 2026-09-09 17:45:46 +03:00
parent 48fe5993d2
commit ca74cc5bfc
2 changed files with 13 additions and 20 deletions

View File

@ -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

View File

@ -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: