Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for node existing service accounts #704

Merged
merged 3 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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