Skip to content

Commit

Permalink
Merge pull request #704 from mper0003/master
Browse files Browse the repository at this point in the history
Add support for node existing service accounts
  • Loading branch information
k8s-ci-robot authored Feb 8, 2021
2 parents 5af60ea + 0fb4ff1 commit 049e1a1
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,4 @@ generate-kustomize: bin/helm
cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/rolebinding-snapshot-controller-leaderelection.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/overlays/alpha/rbac_add_snapshot_controller_leaderelection_rolebinding.yaml
cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-snapshot-controller.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/overlays/alpha/serviceaccount-snapshot-controller.yaml
cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/statefulset.yaml -f ../../deploy/kubernetes/values/snapshotter.yaml > ../../deploy/kubernetes/overlays/alpha/snapshot_controller.yaml
cd charts/aws-ebs-csi-driver && ../../bin/helm template kustomize . -s templates/serviceaccount-csi-node.yaml > ../../deploy/kubernetes/base/serviceaccount-csi-node.yaml
2 changes: 1 addition & 1 deletion charts/aws-ebs-csi-driver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "0.9.0"
name: aws-ebs-csi-driver
description: A Helm chart for AWS EBS CSI Driver
version: 0.9.2
version: 0.9.3
kubeVersion: ">=1.17.0-0"
home: https://github.com/kubernetes-sigs/aws-ebs-csi-driver
sources:
Expand Down
1 change: 1 addition & 0 deletions charts/aws-ebs-csi-driver/templates/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ spec:
{{ toYaml . | indent 8 }}
{{- end }}
hostNetwork: true
serviceAccountName: {{ .Values.serviceAccount.node.name }}
priorityClassName: system-node-critical
tolerations:
{{- if .Values.node.tolerateAllTaints }}
Expand Down
12 changes: 12 additions & 0 deletions charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.node.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount.node.name }}
namespace: kube-system
labels:
{{- include "aws-ebs-csi-driver.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.node.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/aws-ebs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ serviceAccount:
create: true
name: ebs-snapshot-controller
annotations: {}
node:
create: true
name: ebs-csi-node-sa
annotations: {}

storageClasses: []
# Add StorageClass resources like:
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ resources:
- csidriver.yaml
- node.yaml
- serviceaccount-csi-controller.yaml
- serviceaccount-csi-node.yaml
1 change: 1 addition & 0 deletions deploy/kubernetes/base/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
nodeSelector:
kubernetes.io/os: linux
hostNetwork: true
serviceAccountName: ebs-csi-node-sa
priorityClassName: system-node-critical
tolerations:
- operator: Exists
Expand Down
9 changes: 9 additions & 0 deletions deploy/kubernetes/base/serviceaccount-csi-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
# Source: aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: ebs-csi-node-sa
namespace: kube-system
labels:
app.kubernetes.io/name: aws-ebs-csi-driver

0 comments on commit 049e1a1

Please sign in to comment.