Skip to content

Commit

Permalink
Merge pull request #1759 from andyzhangx/fix-runOnControlPlane-1.24
Browse files Browse the repository at this point in the history
[release-1.24] fix: runOnControlPlane chart config
  • Loading branch information
andyzhangx authored Dec 17, 2024
2 parents 173e63a + 4e9cf5a commit 13e2e16
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ 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/blob.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/blob.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/blob.buildDate=${BUILD_DATE} -s -w -extldflags '-static'"
E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set node.blobfuseProxy.migrateK8sRepo=true --set controller.runOnControlPlane=true
ifdef ENABLE_BLOBFUSE_PROXY
E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set controller.logLevel=6 --set node.logLevel=6 --set node.enableBlobfuseProxy=true --set node.blobfuseProxy.migrateK8sRepo=true
else
E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set node.blobfuseProxy.migrateK8sRepo=true
E2E_HELM_OPTIONS += --set node.enableBlobfuseProxy=true --set image.blob.pullPolicy=Always --set controller.logLevel=6 --set node.logLevel=6
endif
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
GO111MODULE = on
Expand Down
Binary file modified charts/latest/blob-csi-driver-v1.24.5.tgz
Binary file not shown.
31 changes: 21 additions & 10 deletions charts/latest/blob-csi-driver/templates/csi-blob-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ spec:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- with .Values.controller.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
Expand All @@ -40,12 +36,27 @@ spec:
serviceAccountName: {{ .Values.serviceAccount.controller }}
nodeSelector:
kubernetes.io/os: linux
{{- 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 }}
{{- with .Values.controller.nodeSelector }}
{{ toYaml . | indent 8 }}
{{- end }}
Expand Down

0 comments on commit 13e2e16

Please sign in to comment.