Skip to content

Commit

Permalink
fix: runOnControlPlane chart config
Browse files Browse the repository at this point in the history
  • Loading branch information
andyzhangx committed Dec 10, 2024
1 parent fc83f7a commit b704e0d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
endif
LDFLAGS = -X ${PKG}/pkg/smb.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/smb.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/smb.buildDate=${BUILD_DATE}
EXT_LDFLAGS = -s -w -extldflags "-static"
E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION)
E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION) --set controller.runOnControlPlane=true
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
# Generate all combination of all OS, ARCH, and OSVERSIONS for iteration
ALL_OS = linux windows
Expand Down
Binary file modified charts/latest/csi-driver-smb-v0.0.0.tgz
Binary file not shown.
26 changes: 20 additions & 6 deletions charts/latest/csi-driver-smb/templates/csi-smb-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,27 @@ spec:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- with .Values.controller.affinity }}
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
{{- with .Values.controller.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- else if .Values.controller.runOnControlPlane}}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
{{- end }}
serviceAccountName: {{ .Values.serviceAccount.controller }}
hostNetwork: true
dnsPolicy: {{ .Values.controller.dnsPolicy }}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- if .Values.securityContext }}
securityContext: {{- toYaml .Values.securityContext | nindent 8 }}
{{- end }}
hostNetwork: true
dnsPolicy: {{ .Values.controller.dnsPolicy }}
serviceAccountName: {{ .Values.serviceAccount.controller }}
Expand All @@ -39,9 +56,6 @@ spec:
{{- if .Values.controller.runOnMaster}}
node-role.kubernetes.io/master: ""
{{- end}}
{{- if .Values.controller.runOnControlPlane}}
node-role.kubernetes.io/control-plane: ""
{{- end}}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- if .Values.securityContext }}
securityContext: {{- toYaml .Values.securityContext | nindent 8 }}
Expand Down

0 comments on commit b704e0d

Please sign in to comment.