Skip to content

Commit

Permalink
Merge pull request #882 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 11, 2024
2 parents c9215d1 + 975289f commit a8dbff5
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BUILD_DATE := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
endif
LDFLAGS = -X ${PKG}/pkg/smb.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/smb.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/smb.buildDate=${BUILD_DATE}
EXT_LDFLAGS = -s -w -extldflags "-static"
E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION)
E2E_HELM_OPTIONS ?= --set image.smb.repository=$(REGISTRY)/$(IMAGENAME) --set image.smb.tag=$(IMAGE_VERSION) --set controller.runOnControlPlane=true
E2E_HELM_OPTIONS += ${EXTRA_HELM_OPTIONS}
# Generate all combination of all OS, ARCH, and OSVERSIONS for iteration
ALL_OS = linux windows
Expand Down
3 changes: 1 addition & 2 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

- run smb-controller on control plane node: `--set controller.runOnControlPlane=true`
- Microk8s based kubernetes recommended settings:
- `--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.
- `--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.

### install a specific version

Expand Down
Binary file modified charts/latest/csi-driver-smb-v0.0.0.tgz
Binary file not shown.
19 changes: 13 additions & 6 deletions charts/latest/csi-driver-smb/templates/csi-smb-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ spec:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- with .Values.controller.affinity }}
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
{{- with .Values.controller.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- else if .Values.controller.runOnControlPlane}}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
{{- end }}
hostNetwork: true
dnsPolicy: {{ .Values.controller.dnsPolicy }}
serviceAccountName: {{ .Values.serviceAccount.controller }}
Expand All @@ -39,9 +49,6 @@ spec:
{{- if .Values.controller.runOnMaster}}
node-role.kubernetes.io/master: ""
{{- end}}
{{- if .Values.controller.runOnControlPlane}}
node-role.kubernetes.io/control-plane: ""
{{- end}}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- if .Values.securityContext }}
securityContext: {{- toYaml .Values.securityContext | nindent 8 }}
Expand Down
Binary file modified charts/v1.16.0/csi-driver-smb-v1.16.0.tgz
Binary file not shown.
19 changes: 13 additions & 6 deletions charts/v1.16.0/csi-driver-smb/templates/csi-smb-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ spec:
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec:
{{- with .Values.controller.affinity }}
{{- if contains (tpl "{{ .Values.controller.affinity }}" .) "nodeSelectorTerms" }}
{{- with .Values.controller.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- else if .Values.controller.runOnControlPlane}}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
{{- end }}
hostNetwork: true
dnsPolicy: {{ .Values.controller.dnsPolicy }}
serviceAccountName: {{ .Values.serviceAccount.controller }}
Expand All @@ -39,9 +49,6 @@ spec:
{{- if .Values.controller.runOnMaster}}
node-role.kubernetes.io/master: ""
{{- end}}
{{- if .Values.controller.runOnControlPlane}}
node-role.kubernetes.io/control-plane: ""
{{- end}}
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- if .Values.securityContext }}
securityContext: {{- toYaml .Values.securityContext | nindent 8 }}
Expand Down
2 changes: 2 additions & 0 deletions deploy/example/e2e_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ parameters:
csi.storage.k8s.io/node-stage-secret-namespace: default
reclaimPolicy: Delete # available values: Delete, Retain
volumeBindingMode: Immediate
allowVolumeExpansion: true
mountOptions:
- dir_mode=0777
- file_mode=0777
Expand Down Expand Up @@ -59,6 +60,7 @@ parameters:
csi.storage.k8s.io/node-stage-secret-name: smbcreds
csi.storage.k8s.io/node-stage-secret-namespace: default
volumeBindingMode: Immediate
allowVolumeExpansion: true
mountOptions:
- dir_mode=0777
- file_mode=0777
Expand Down
1 change: 1 addition & 0 deletions deploy/example/storageclass-smb-krb5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ parameters:
csi.storage.k8s.io/node-stage-secret-name: smbcreds-krb5
csi.storage.k8s.io/node-stage-secret-namespace: default
volumeBindingMode: Immediate
allowVolumeExpansion: true
mountOptions:
- sec=krb5
- cruid=1000
Expand Down
1 change: 1 addition & 0 deletions deploy/example/storageclass-smb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ parameters:
csi.storage.k8s.io/node-stage-secret-name: smbcreds
csi.storage.k8s.io/node-stage-secret-namespace: default
volumeBindingMode: Immediate
allowVolumeExpansion: true
mountOptions:
- dir_mode=0777
- file_mode=0777
Expand Down
2 changes: 2 additions & 0 deletions deploy/example/windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ kind: StorageClass
metadata:
name: smb
provisioner: smb.csi.k8s.io
allowVolumeExpansion: true
parameters:
source: //smb-server.default.svc.cluster.local/share
...
Expand Down Expand Up @@ -81,6 +82,7 @@ kind: StorageClass
metadata:
name: smb
provisioner: smb.csi.k8s.io
allowVolumeExpansion: true
parameters:
source: //10.111.254.254/share
...
Expand Down

0 comments on commit a8dbff5

Please sign in to comment.