(dev-v2.6-archive) Update node selector logic to use node affinity

(partially cherry picked from commit 5a430f7a9c)
pull/1680/head
Steven Crespo 2021-08-27 17:34:25 -07:00 committed by Arvind Iyengar
parent 47a70d4388
commit 5d9e78d3c2
No known key found for this signature in database
GPG Key ID: A8DD9BFD6C811498
1 changed files with 18 additions and 3 deletions

View File

@ -15,15 +15,30 @@ spec:
app: vsphere-csi-controller
role: vsphere-csi
spec:
serviceAccountName: vsphere-csi-controller
nodeSelector:
{{- if .Values.csiController.nodeSelector }}
nodeSelector:
{{- with .Values.csiController.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- else }}
node-role.kubernetes.io/controlplane: "true"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
# RKE node selector label
- key: node-role.kubernetes.io/controlplane
operator: In
values:
- "true"
- matchExpressions:
# RKE2 node selector label
- key: node-role.kubernetes.io/control-plane
operator: In
values:
- "true"
{{- end }}
serviceAccountName: vsphere-csi-controller
tolerations:
# Rancher specific change: These tolerations are intentionally different from upstream to avoid lessening the scope to only NoSchedule with a specific key
# - key: node-role.kubernetes.io/master