Skip to content

Commit 4e99bc9

Browse files
authored
Merge pull request #480 from andyzhangx/node-serviceAccount
fix: add serviceAccount for driver daemonset running on the node
2 parents b8e368b + 016ebce commit 4e99bc9

File tree

10 files changed

+21
-5
lines changed

10 files changed

+21
-5
lines changed
6 Bytes
Binary file not shown.

charts/latest/csi-driver-smb/templates/csi-smb-node-windows.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ spec:
2525
nodeSelector:
2626
kubernetes.io/os: windows
2727
priorityClassName: system-node-critical
28+
serviceAccountName: csi-smb-node-sa
2829
{{- include "smb.pullSecrets" . | indent 6 }}
2930
containers:
3031
- name: liveness-probe

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ spec:
2727
spec:
2828
hostNetwork: true
2929
dnsPolicy: {{ .Values.linux.dnsPolicy }}
30+
serviceAccountName: csi-smb-node-sa
3031
nodeSelector:
3132
kubernetes.io/os: linux
3233
{{- with .Values.node.nodeSelector }}

charts/latest/csi-driver-smb/templates/rbac-csi-smb-controller.yaml renamed to charts/latest/csi-driver-smb/templates/rbac-csi-smb.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ metadata:
66
name: {{ .Values.serviceAccount.controller }}
77
namespace: {{ .Release.Namespace }}
88
{{ include "smb.labels" . | indent 2 }}
9+
---
10+
apiVersion: v1
11+
kind: ServiceAccount
12+
metadata:
13+
name: {{ .Values.serviceAccount.node }}
14+
namespace: {{ .Release.Namespace }}
15+
{{ include "smb.labels" . | indent 2 }}
916
{{ end }}
1017

1118
{{- if .Values.rbac.create -}}

charts/latest/csi-driver-smb/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ image:
1919

2020
serviceAccount:
2121
create: true # When true, service accounts will be created for you. Set to false if you want to use your own.
22-
controller: csi-smb-controller-sa # Name of Service Account to be created or used
22+
controller: csi-smb-controller-sa
23+
node: csi-smb-node-sa
2324

2425
rbac:
2526
create: true

deploy/csi-smb-node-windows.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ spec:
2424
nodeSelector:
2525
kubernetes.io/os: windows
2626
priorityClassName: system-node-critical
27+
serviceAccountName: csi-smb-node-sa
2728
containers:
2829
- name: liveness-probe
2930
volumeMounts:

deploy/csi-smb-node.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ spec:
1919
spec:
2020
hostNetwork: true
2121
dnsPolicy: Default # available values: Default, ClusterFirstWithHostNet, ClusterFirst
22+
serviceAccountName: csi-smb-node-sa
2223
nodeSelector:
2324
kubernetes.io/os: linux
2425
priorityClassName: system-node-critical

deploy/install-driver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [ $ver != "master" ]; then
3434
fi
3535

3636
echo "Installing SMB CSI driver, version: $ver ..."
37-
kubectl apply -f $repo/rbac-csi-smb-controller.yaml
37+
kubectl apply -f $repo/rbac-csi-smb.yaml
3838
kubectl apply -f $repo/csi-smb-driver.yaml
3939
kubectl apply -f $repo/csi-smb-controller.yaml
4040
kubectl apply -f $repo/csi-smb-node.yaml
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ kind: ServiceAccount
44
metadata:
55
name: csi-smb-controller-sa
66
namespace: kube-system
7-
87
---
9-
8+
apiVersion: v1
9+
kind: ServiceAccount
10+
metadata:
11+
name: csi-smb-node-sa
12+
namespace: kube-system
13+
---
1014
kind: ClusterRole
1115
apiVersion: rbac.authorization.k8s.io/v1
1216
metadata:

deploy/uninstall-driver.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ kubectl delete -f $repo/csi-smb-controller.yaml --ignore-not-found
3838
kubectl delete -f $repo/csi-smb-node.yaml --ignore-not-found
3939
kubectl delete -f $repo/csi-smb-node-windows.yaml --ignore-not-found
4040
kubectl delete -f $repo/csi-smb-driver.yaml --ignore-not-found
41-
kubectl delete -f $repo/rbac-csi-smb-controller.yaml --ignore-not-found
41+
kubectl delete -f $repo/rbac-csi-smb.yaml --ignore-not-found
4242
echo 'Uninstalled SMB CSI driver successfully.'

0 commit comments

Comments
 (0)