feat: support runOnControlPlane on csi-snapshot-controller

This commit is contained in:
andyzhangx 2024-12-16 14:22:44 +00:00
parent d21d7bb117
commit b347eef40e
2 changed files with 21 additions and 0 deletions

View File

@ -46,6 +46,27 @@ spec:
{{- end }}
nodeSelector:
kubernetes.io/os: linux
# runOnControlPlane=true or runOnMaster=true only takes effect if affinity is not set
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
{{- with .Values.controller.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- else if or .Values.controller.runOnControlPlane .Values.controller.runOnMaster}}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
{{- if .Values.controller.runOnControlPlane}}
- key: node-role.kubernetes.io/control-plane
operator: Exists
{{- end}}
{{- if .Values.controller.runOnMaster}}
- key: node-role.kubernetes.io/master
operator: Exists
{{- end}}
{{- end }}
priorityClassName: {{ .Values.externalSnapshotter.priorityClassName }}
securityContext:
seccompProfile: