diff --git a/Makefile b/Makefile index 57ed3b1961..096e207601 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index 82d0ec6945..c308ca5586 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -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: diff --git a/charts/aws-ebs-csi-driver/templates/node.yaml b/charts/aws-ebs-csi-driver/templates/node.yaml index 2b1bf5bd36..b32958d16a 100644 --- a/charts/aws-ebs-csi-driver/templates/node.yaml +++ b/charts/aws-ebs-csi-driver/templates/node.yaml @@ -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 }} diff --git a/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml b/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml new file mode 100644 index 0000000000..afe0218559 --- /dev/null +++ b/charts/aws-ebs-csi-driver/templates/serviceaccount-csi-node.yaml @@ -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 -}} diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index c78e0da251..bb4a609beb 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -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: diff --git a/deploy/kubernetes/base/kustomization.yaml b/deploy/kubernetes/base/kustomization.yaml index f6978d7e21..b56941c7be 100644 --- a/deploy/kubernetes/base/kustomization.yaml +++ b/deploy/kubernetes/base/kustomization.yaml @@ -10,3 +10,4 @@ resources: - csidriver.yaml - node.yaml - serviceaccount-csi-controller.yaml +- serviceaccount-csi-node.yaml diff --git a/deploy/kubernetes/base/node.yaml b/deploy/kubernetes/base/node.yaml index 56e7a4f77c..79c332d8a9 100644 --- a/deploy/kubernetes/base/node.yaml +++ b/deploy/kubernetes/base/node.yaml @@ -31,6 +31,7 @@ spec: nodeSelector: kubernetes.io/os: linux hostNetwork: true + serviceAccountName: ebs-csi-node-sa priorityClassName: system-node-critical tolerations: - operator: Exists diff --git a/deploy/kubernetes/base/serviceaccount-csi-node.yaml b/deploy/kubernetes/base/serviceaccount-csi-node.yaml new file mode 100644 index 0000000000..c9be661a10 --- /dev/null +++ b/deploy/kubernetes/base/serviceaccount-csi-node.yaml @@ -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