@@ -24,10 +24,27 @@ spec:
2424{{ toYaml .Values.podAnnotations | indent 8 }}
2525{{- end }}
2626 spec :
27- {{- with .Values.controller.affinity }}
27+ {{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
28+ {{- with .Values.controller.affinity }}
2829 affinity :
29- {{ toYaml . | indent 8 }}
30- {{- end }}
30+ {{ toYaml . | indent 8 }}
31+ {{- end }}
32+ {{- else if .Values.controller.runOnControlPlane}}
33+ affinity :
34+ nodeAffinity :
35+ requiredDuringSchedulingIgnoredDuringExecution :
36+ nodeSelectorTerms :
37+ - matchExpressions :
38+ - key : node-role.kubernetes.io/control-plane
39+ operator : Exists
40+ {{- end }}
41+ serviceAccountName : {{ .Values.serviceAccount.controller }}
42+ hostNetwork : true
43+ dnsPolicy : {{ .Values.controller.dnsPolicy }}
44+ priorityClassName : {{ .Values.priorityClassName | quote }}
45+ {{- if .Values.securityContext }}
46+ securityContext : {{- toYaml .Values.securityContext | nindent 8 }}
47+ {{- end }}
3148 hostNetwork : true
3249 dnsPolicy : {{ .Values.controller.dnsPolicy }}
3350 serviceAccountName : {{ .Values.serviceAccount.controller }}
3956 {{- if .Values.controller.runOnMaster}}
4057 node-role.kubernetes.io/master : " "
4158 {{- end}}
42- {{- if .Values.controller.runOnControlPlane}}
43- node-role.kubernetes.io/control-plane : " "
44- {{- end}}
4559 priorityClassName : {{ .Values.priorityClassName | quote }}
4660 {{- if .Values.securityContext }}
4761 securityContext : {{- toYaml .Values.securityContext | nindent 8 }}
0 commit comments