Skip to content

Commit

Permalink
feat: add support for defining preexisting sa
Browse files Browse the repository at this point in the history
  • Loading branch information
kassarl committed Jun 10, 2021
1 parent e61720b commit 765ca8a
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
hostNetwork: true
serviceAccountName: csi-azuredisk-controller-sa
serviceAccountName: {{ .Values.serviceAccount.controller.name }}
nodeSelector:
kubernetes.io/os: linux
{{- if .Values.controller.runOnMaster}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
{{ include "azuredisk.labels" . | indent 6 }}
app: csi-azuredisk-node-win
spec:
serviceAccountName: csi-azuredisk-node-sa
serviceAccountName: {{ .Values.serviceAccount.node.name }}
tolerations:
- key: "node.kubernetes.io/os"
operator: "Exists"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
{{- end }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
serviceAccountName: csi-azuredisk-node-sa
serviceAccountName: {{ .Values.serviceAccount.node.name }}
nodeSelector:
kubernetes.io/os: linux
affinity:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
{{ include "azuredisk.labels" . | indent 6 }}
app: csi-snapshot-controller
spec:
serviceAccountName: csi-snapshot-controller-sa
serviceAccountName: {{ .Values.serviceAccount.snapshotcontroller.name }}
nodeSelector:
kubernetes.io/os: linux
priorityClassName: system-cluster-critical
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ metadata:
{{ include "azuredisk.labels" . | indent 2 }}
subjects:
- kind: ServiceAccount
name: csi-azuredisk-controller-sa
name: {{ .Values.serviceAccount.controller.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down Expand Up @@ -84,7 +84,7 @@ metadata:
{{ include "azuredisk.labels" . | indent 2 }}
subjects:
- kind: ServiceAccount
name: csi-azuredisk-controller-sa
name: {{ .Values.serviceAccount.controller.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down Expand Up @@ -129,7 +129,7 @@ metadata:
{{ include "azuredisk.labels" . | indent 2 }}
subjects:
- kind: ServiceAccount
name: csi-azuredisk-controller-sa
name: {{ .Values.serviceAccount.controller.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down Expand Up @@ -169,7 +169,7 @@ metadata:
{{ include "azuredisk.labels" . | indent 2 }}
subjects:
- kind: ServiceAccount
name: csi-azuredisk-controller-sa
name: {{ .Values.serviceAccount.controller.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand All @@ -193,7 +193,7 @@ metadata:
name: csi-azuredisk-controller-secret-binding
subjects:
- kind: ServiceAccount
name: csi-azuredisk-controller-sa
name: {{ .Values.serviceAccount.controller.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
name: csi-azuredisk-node-secret-binding
subjects:
- kind: ServiceAccount
name: csi-azuredisk-node-sa
name: {{ .Values.serviceAccount.node.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ metadata:
name: csi-snapshot-controller-binding
subjects:
- kind: ServiceAccount
name: csi-snapshot-controller-sa
name: {{ .Values.serviceAccount.snapshotcontroller.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand All @@ -60,7 +60,7 @@ metadata:
name: csi-snapshot-controller-leaderelection-binding
subjects:
- kind: ServiceAccount
name: csi-snapshot-controller-sa
name: {{ .Values.serviceAccount.snapshotcontroller.name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-azuredisk-controller-sa
name: {{ .Values.serviceAccount.controller.name }}
namespace: {{ .Release.Namespace }}
{{ include "azuredisk.labels" . | indent 2 }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-azuredisk-node-sa
name: {{ .Values.serviceAccount.node.name }}
namespace: {{ .Release.Namespace }}
{{ include "azuredisk.labels" . | indent 2 }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: csi-snapshot-controller-sa
name: {{ .Values.serviceAccount.snapshotcontroller.name }}
namespace: {{ .Release.Namespace }}
{{- end -}}
12 changes: 9 additions & 3 deletions charts/latest/azuredisk-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@ image:
pullPolicy: IfNotPresent

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

rbac:
create: true

controller:
replicas: 2
metricsPort: 29604
Expand Down Expand Up @@ -59,7 +65,7 @@ snapshot:
pullPolicy: IfNotPresent
snapshotController:
replicas: 1
serviceAccount: true
serviceAccount: true # When true, a service account will be created for you. Set to false if you want to use your own.
rbac: true

feature:
Expand Down

0 comments on commit 765ca8a

Please sign in to comment.