Merge pull request #823 from andyzhangx/runOnControlPlane-snapshot

feat: support runOnControlPlane on csi-snapshot-controller
This commit is contained in:
Andy Zhang 2024-12-17 10:11:18 +08:00 committed by GitHub
commit 6b69b9b282
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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: