Skip to content

Commit a8dbff5

Browse files
authored
Merge pull request #882 from andyzhangx/fix-runOnControlPlane
fix: runOnControlPlane chart config
2 parents c9215d1 + 975289f commit a8dbff5

File tree

10 files changed

+34
-15
lines changed

10 files changed

+34
-15
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
4444
endif
4545
LDFLAGS = -X ${PKG}/pkg/smb.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/smb.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/smb.buildDate=${BUILD_DATE}
4646
EXT_LDFLAGS = -s -w -extldflags "-static"
47-
E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION)
47+
E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION) --set controller.runOnControlPlane=true
4848
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
4949
# Generate all combination of all OS, ARCH, and OSVERSIONS for iteration
5050
ALL_OS = linux windows

charts/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
- run smb-controller on control plane node: `--set controller.runOnControlPlane=true`
1010
- Microk8s based kubernetes recommended settings:
11-
- `--set linux.kubelet="/var/snap/microk8s/common/var/lib/kubelet"` - sets correct path to microk8s kubelet even
12-
though a user has a folder link to it.
11+
- `--set linux.kubelet="/var/snap/microk8s/common/var/lib/kubelet"` - sets correct path to microk8s kubelet even though a user has a folder link to it.
1312

1413
### install a specific version
1514

96 Bytes
Binary file not shown.

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,20 @@ spec:
2424
{{ toYaml .Values.podAnnotations | indent 8 }}
2525
{{- end }}
2626
spec:
27-
{{- with .Values.controller.affinity }}
27+
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
28+
{{- with .Values.controller.affinity }}
2829
affinity:
29-
{{ toYaml . | indent 8 }}
30-
{{- end }}
30+
{{ toYaml . | indent 8 }}
31+
{{- end }}
32+
{{- else if .Values.controller.runOnControlPlane}}
33+
affinity:
34+
nodeAffinity:
35+
requiredDuringSchedulingIgnoredDuringExecution:
36+
nodeSelectorTerms:
37+
- matchExpressions:
38+
- key: node-role.kubernetes.io/control-plane
39+
operator: Exists
40+
{{- end }}
3141
hostNetwork: true
3242
dnsPolicy: {{ .Values.controller.dnsPolicy }}
3343
serviceAccountName: {{ .Values.serviceAccount.controller }}
@@ -39,9 +49,6 @@ spec:
3949
{{- if .Values.controller.runOnMaster}}
4050
node-role.kubernetes.io/master: ""
4151
{{- end}}
42-
{{- if .Values.controller.runOnControlPlane}}
43-
node-role.kubernetes.io/control-plane: ""
44-
{{- end}}
4552
priorityClassName: {{ .Values.priorityClassName | quote }}
4653
{{- if .Values.securityContext }}
4754
securityContext: {{- toYaml .Values.securityContext | nindent 8 }}
98 Bytes
Binary file not shown.

charts/v1.16.0/csi-driver-smb/templates/csi-smb-controller.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,20 @@ spec:
2424
{{ toYaml .Values.podAnnotations | indent 8 }}
2525
{{- end }}
2626
spec:
27-
{{- with .Values.controller.affinity }}
27+
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
28+
{{- with .Values.controller.affinity }}
2829
affinity:
29-
{{ toYaml . | indent 8 }}
30-
{{- end }}
30+
{{ toYaml . | indent 8 }}
31+
{{- end }}
32+
{{- else if .Values.controller.runOnControlPlane}}
33+
affinity:
34+
nodeAffinity:
35+
requiredDuringSchedulingIgnoredDuringExecution:
36+
nodeSelectorTerms:
37+
- matchExpressions:
38+
- key: node-role.kubernetes.io/control-plane
39+
operator: Exists
40+
{{- end }}
3141
hostNetwork: true
3242
dnsPolicy: {{ .Values.controller.dnsPolicy }}
3343
serviceAccountName: {{ .Values.serviceAccount.controller }}
@@ -39,9 +49,6 @@ spec:
3949
{{- if .Values.controller.runOnMaster}}
4050
node-role.kubernetes.io/master: ""
4151
{{- end}}
42-
{{- if .Values.controller.runOnControlPlane}}
43-
node-role.kubernetes.io/control-plane: ""
44-
{{- end}}
4552
priorityClassName: {{ .Values.priorityClassName | quote }}
4653
{{- if .Values.securityContext }}
4754
securityContext: {{- toYaml .Values.securityContext | nindent 8 }}

deploy/example/e2e_usage.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ parameters:
2929
csi.storage.k8s.io/node-stage-secret-namespace: default
3030
reclaimPolicy: Delete # available values: Delete, Retain
3131
volumeBindingMode: Immediate
32+
allowVolumeExpansion: true
3233
mountOptions:
3334
- dir_mode=0777
3435
- file_mode=0777
@@ -59,6 +60,7 @@ parameters:
5960
csi.storage.k8s.io/node-stage-secret-name: smbcreds
6061
csi.storage.k8s.io/node-stage-secret-namespace: default
6162
volumeBindingMode: Immediate
63+
allowVolumeExpansion: true
6264
mountOptions:
6365
- dir_mode=0777
6466
- file_mode=0777

deploy/example/storageclass-smb-krb5.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ parameters:
1414
csi.storage.k8s.io/node-stage-secret-name: smbcreds-krb5
1515
csi.storage.k8s.io/node-stage-secret-namespace: default
1616
volumeBindingMode: Immediate
17+
allowVolumeExpansion: true
1718
mountOptions:
1819
- sec=krb5
1920
- cruid=1000

deploy/example/storageclass-smb.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ parameters:
1414
csi.storage.k8s.io/node-stage-secret-name: smbcreds
1515
csi.storage.k8s.io/node-stage-secret-namespace: default
1616
volumeBindingMode: Immediate
17+
allowVolumeExpansion: true
1718
mountOptions:
1819
- dir_mode=0777
1920
- file_mode=0777

deploy/example/windows/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ kind: StorageClass
3939
metadata:
4040
name: smb
4141
provisioner: smb.csi.k8s.io
42+
allowVolumeExpansion: true
4243
parameters:
4344
source: //smb-server.default.svc.cluster.local/share
4445
...
@@ -81,6 +82,7 @@ kind: StorageClass
8182
metadata:
8283
name: smb
8384
provisioner: smb.csi.k8s.io
85+
allowVolumeExpansion: true
8486
parameters:
8587
source: //10.111.254.254/share
8688
...

0 commit comments

Comments
 (0)