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 16, 2024
1 parent a944921 commit 0a51425
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CSI_IMAGE_TAG ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_VERSION)
CSI_IMAGE_TAG_LATEST = $(REGISTRY)/$(IMAGE_NAME):latest
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS ?= "-X ${PKG}/pkg/azurefile.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/azurefile.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/azurefile.buildDate=${BUILD_DATE} -s -w -extldflags '-static'"
E2E_HELM_OPTIONS ?= --set image.azurefile.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.azurefile.tag=$(IMAGE_VERSION) --set node.enableKataCCMount=true --set linux.dnsPolicy=ClusterFirstWithHostNet --set driver.userAgentSuffix="e2e-test"
E2E_HELM_OPTIONS ?= --set image.azurefile.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.azurefile.tag=$(IMAGE_VERSION) --set node.enableKataCCMount=true --set linux.dnsPolicy=ClusterFirstWithHostNet --set driver.userAgentSuffix="e2e-test" --set controller.runOnControlPlane=true
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
ifdef KUBERNETES_VERSION # disable kubelet-registration-probe on capz cluster testing
E2E_HELM_OPTIONS += --set linux.enableRegistrationProbe=false --set windows.enableRegistrationProbe=false
Expand Down
Binary file modified charts/latest/azurefile-csi-driver-v0.0.0.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,34 @@ spec:
{{- with .Values.controller.nodeSelector }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.controller.runOnMaster}}
node-role.kubernetes.io/master: ""
{{- end}}
{{- if .Values.controller.runOnControlPlane}}
node-role.kubernetes.io/control-plane: ""
{{- end}}
# 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: system-cluster-critical
securityContext:
seccompProfile:
type: RuntimeDefault
{{- with .Values.controller.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.controller.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down

0 comments on commit 0a51425

Please sign in to comment.