Skip to content

Commit

Permalink
Merge pull request #480 from andyzhangx/node-serviceAccount
Browse files Browse the repository at this point in the history
fix: add serviceAccount for driver daemonset running on the node
  • Loading branch information
andyzhangx authored May 15, 2022
2 parents b8e368b + 016ebce commit 4e99bc9
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 5 deletions.
Binary file modified charts/latest/csi-driver-smb-v1.7.0.tgz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ spec:
nodeSelector:
kubernetes.io/os: windows
priorityClassName: system-node-critical
serviceAccountName: csi-smb-node-sa
{{- include "smb.pullSecrets" . | indent 6 }}
containers:
- name: liveness-probe
Expand Down
1 change: 1 addition & 0 deletions charts/latest/csi-driver-smb/templates/csi-smb-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
spec:
hostNetwork: true
dnsPolicy: {{ .Values.linux.dnsPolicy }}
serviceAccountName: csi-smb-node-sa
nodeSelector:
kubernetes.io/os: linux
{{- with .Values.node.nodeSelector }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ metadata:
name: {{ .Values.serviceAccount.controller }}
namespace: {{ .Release.Namespace }}
{{ include "smb.labels" . | indent 2 }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.node }}
namespace: {{ .Release.Namespace }}
{{ include "smb.labels" . | indent 2 }}
{{ end }}

{{- if .Values.rbac.create -}}
Expand Down
3 changes: 2 additions & 1 deletion charts/latest/csi-driver-smb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ image:

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

rbac:
create: true
Expand Down
1 change: 1 addition & 0 deletions deploy/csi-smb-node-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
nodeSelector:
kubernetes.io/os: windows
priorityClassName: system-node-critical
serviceAccountName: csi-smb-node-sa
containers:
- name: liveness-probe
volumeMounts:
Expand Down
1 change: 1 addition & 0 deletions deploy/csi-smb-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
spec:
hostNetwork: true
dnsPolicy: Default # available values: Default, ClusterFirstWithHostNet, ClusterFirst
serviceAccountName: csi-smb-node-sa
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-node-critical
Expand Down
2 changes: 1 addition & 1 deletion deploy/install-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [ $ver != "master" ]; then
fi

echo "Installing SMB CSI driver, version: $ver ..."
kubectl apply -f $repo/rbac-csi-smb-controller.yaml
kubectl apply -f $repo/rbac-csi-smb.yaml
kubectl apply -f $repo/csi-smb-driver.yaml
kubectl apply -f $repo/csi-smb-controller.yaml
kubectl apply -f $repo/csi-smb-node.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ kind: ServiceAccount
metadata:
name: csi-smb-controller-sa
namespace: kube-system

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-smb-node-sa
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand Down
2 changes: 1 addition & 1 deletion deploy/uninstall-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ kubectl delete -f $repo/csi-smb-controller.yaml --ignore-not-found
kubectl delete -f $repo/csi-smb-node.yaml --ignore-not-found
kubectl delete -f $repo/csi-smb-node-windows.yaml --ignore-not-found
kubectl delete -f $repo/csi-smb-driver.yaml --ignore-not-found
kubectl delete -f $repo/rbac-csi-smb-controller.yaml --ignore-not-found
kubectl delete -f $repo/rbac-csi-smb.yaml --ignore-not-found
echo 'Uninstalled SMB CSI driver successfully.'

0 comments on commit 4e99bc9

Please sign in to comment.