[flant] added nodeselector and tolerations
This commit is contained in:
parent
48fe5993d2
commit
ca74cc5bfc
@ -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
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user