Skip to content

Commit 6fe6ad1

Browse files
authored
Merge pull request #1754 from andyzhangx/fix-runOnControlPlane
fix: runOnControlPlane chart config
2 parents cd7a330 + 1331337 commit 6fe6ad1

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ CSI_IMAGE_TAG ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_VERSION)
2929
CSI_IMAGE_TAG_LATEST = $(REGISTRY)/$(IMAGE_NAME):latest
3030
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
3131
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'"
32+
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
3233
ifdef ENABLE_BLOBFUSE_PROXY
33-
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
34-
else
35-
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
34+
E2E_HELM_OPTIONS += --set node.enableBlobfuseProxy=true --set image.blob.pullPolicy=Always --set controller.logLevel=6 --set node.logLevel=6
3635
endif
3736
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
3837
GO111MODULE = on
83 Bytes
Binary file not shown.

charts/latest/blob-csi-driver/templates/csi-blob-controller.yaml

+21-10
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ spec:
2828
{{ toYaml .Values.podAnnotations | indent 8 }}
2929
{{- end }}
3030
spec:
31-
{{- with .Values.controller.affinity }}
32-
affinity:
33-
{{ toYaml . | indent 8 }}
34-
{{- end }}
3531
{{- if .Values.imagePullSecrets }}
3632
imagePullSecrets:
3733
{{ toYaml .Values.imagePullSecrets | indent 8 }}
@@ -40,12 +36,27 @@ spec:
4036
serviceAccountName: {{ .Values.serviceAccount.controller }}
4137
nodeSelector:
4238
kubernetes.io/os: linux
43-
{{- if .Values.controller.runOnMaster}}
44-
node-role.kubernetes.io/master: ""
45-
{{- end}}
46-
{{- if .Values.controller.runOnControlPlane}}
47-
node-role.kubernetes.io/control-plane: ""
48-
{{- end}}
39+
# runOnControlPlane=true or runOnMaster=true only takes effect if affinity is not set
40+
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
41+
{{- with .Values.controller.affinity }}
42+
affinity:
43+
{{ toYaml . | indent 8 }}
44+
{{- end }}
45+
{{- else if or .Values.controller.runOnControlPlane .Values.controller.runOnMaster}}
46+
affinity:
47+
nodeAffinity:
48+
requiredDuringSchedulingIgnoredDuringExecution:
49+
nodeSelectorTerms:
50+
- matchExpressions:
51+
{{- if .Values.controller.runOnControlPlane}}
52+
- key: node-role.kubernetes.io/control-plane
53+
operator: Exists
54+
{{- end}}
55+
{{- if .Values.controller.runOnMaster}}
56+
- key: node-role.kubernetes.io/master
57+
operator: Exists
58+
{{- end}}
59+
{{- end }}
4960
{{- with .Values.controller.nodeSelector }}
5061
{{ toYaml . | indent 8 }}
5162
{{- end }}

0 commit comments

Comments
 (0)