Skip to content

Commit b347eef

Browse files
committed
feat: support runOnControlPlane on csi-snapshot-controller
1 parent d21d7bb commit b347eef

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
17 Bytes
Binary file not shown.

charts/latest/csi-driver-nfs/templates/csi-snapshot-controller.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ spec:
4646
{{- end }}
4747
nodeSelector:
4848
kubernetes.io/os: linux
49+
# runOnControlPlane=true or runOnMaster=true only takes effect if affinity is not set
50+
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
51+
{{- with .Values.controller.affinity }}
52+
affinity:
53+
{{ toYaml . | indent 8 }}
54+
{{- end }}
55+
{{- else if or .Values.controller.runOnControlPlane .Values.controller.runOnMaster}}
56+
affinity:
57+
nodeAffinity:
58+
requiredDuringSchedulingIgnoredDuringExecution:
59+
nodeSelectorTerms:
60+
- matchExpressions:
61+
{{- if .Values.controller.runOnControlPlane}}
62+
- key: node-role.kubernetes.io/control-plane
63+
operator: Exists
64+
{{- end}}
65+
{{- if .Values.controller.runOnMaster}}
66+
- key: node-role.kubernetes.io/master
67+
operator: Exists
68+
{{- end}}
69+
{{- end }}
4970
priorityClassName: {{ .Values.externalSnapshotter.priorityClassName }}
5071
securityContext:
5172
seccompProfile:

0 commit comments

Comments
 (0)