Skip to content

Commit

Permalink
Merge pull request #2742 from andyzhangx/fix-runOnControlPlane
Browse files Browse the repository at this point in the history
fix: runOnControlPlane chart config
  • Loading branch information
andyzhangx authored Dec 17, 2024
2 parents 30512bc + b722176 commit b2eb45c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ REV = $(shell git describe --long --tags --dirty)
BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
ENABLE_TOPOLOGY ?= false
LDFLAGS ?= "-X ${PKG}/pkg/azuredisk.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/azuredisk.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/azuredisk.buildDate=${BUILD_DATE} -extldflags "-static"" ${GOTAGS}
E2E_HELM_OPTIONS ?= --set image.azuredisk.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.azuredisk.tag=$(IMAGE_VERSION) --set image.azuredisk.pullPolicy=Always --set driver.userAgentSuffix="e2e-test" --set snapshot.VolumeSnapshotClass.enabled=true --set snapshot.enabled=true --set node.getNodeIDFromIMDS=true
E2E_HELM_OPTIONS ?= --set image.azuredisk.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.azuredisk.tag=$(IMAGE_VERSION) --set image.azuredisk.pullPolicy=Always --set driver.userAgentSuffix="e2e-test" --set snapshot.VolumeSnapshotClass.enabled=true --set snapshot.enabled=true --set node.getNodeIDFromIMDS=true --set controller.runOnControlPlane=true --set controller.replicas=1 --set snapshot.snapshotController.replicas=1
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
ifdef DISABLE_ZONE
E2E_HELM_OPTIONS += --set node.supportZone=false
Expand Down
Binary file modified charts/latest/azuredisk-csi-driver-v0.0.0.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,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 }}
{{- include "azuredisk.pullSecrets" . | indent 6 }}
containers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,34 @@ spec:
serviceAccountName: {{ .Values.serviceAccount.snapshotController }}
nodeSelector:
kubernetes.io/os: linux
# 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 }}
{{- include "azuredisk.pullSecrets" . | indent 6 }}
containers:
Expand Down

0 comments on commit b2eb45c

Please sign in to comment.