fix(statefulset):使用affinity管理节点分配

This commit is contained in:
Yu Sun
2022-10-10 16:38:11 +08:00
parent 4a292ef4bb
commit 9fd20de60a
2 changed files with 17 additions and 15 deletions

View File

@@ -120,13 +120,15 @@ spec:
{{- if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName }}
{{- end }}
{{- if .Values.affinity }}
affinity:
{{ .Values.affinity | toYaml | indent 8 }}
{{- else if .Values.affinityTemplate }}
affinity:
{{ tpl .Values.affinityTemplate . | indent 8 }}
{{- end }}
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: NotIn
values:
- an
{{- if not .Values.persistentVolume.enabled }}
- name: storage-volume
emptyDir: {}