From 42dfe272ce185324cc1723f289c3373e014b0499 Mon Sep 17 00:00:00 2001 From: Gazal K Date: Thu, 14 Jan 2021 17:35:30 +1100 Subject: [PATCH] feat: Add option to provision StorageClasses Most application charts don't usually create `StorageClass`es. They create PVCs. --- charts/aws-ebs-csi-driver/Chart.yaml | 2 +- .../templates/storageclass.yaml | 15 +++++++++++++++ charts/aws-ebs-csi-driver/values.yaml | 10 ++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 charts/aws-ebs-csi-driver/templates/storageclass.yaml diff --git a/charts/aws-ebs-csi-driver/Chart.yaml b/charts/aws-ebs-csi-driver/Chart.yaml index ee54061999..567daabdca 100644 --- a/charts/aws-ebs-csi-driver/Chart.yaml +++ b/charts/aws-ebs-csi-driver/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "0.9.0" +appVersion: "0.9.1" name: aws-ebs-csi-driver description: A Helm chart for AWS EBS CSI Driver version: 0.9.0 diff --git a/charts/aws-ebs-csi-driver/templates/storageclass.yaml b/charts/aws-ebs-csi-driver/templates/storageclass.yaml new file mode 100644 index 0000000000..759ff1e0a2 --- /dev/null +++ b/charts/aws-ebs-csi-driver/templates/storageclass.yaml @@ -0,0 +1,15 @@ +{{- range .Values.storageClasses }} +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: {{ .name }} +provisioner: ebs.csi.aws.com +volumeBindingMode: {{ default "WaitForFirstConsumer" .volumeBindingMode }} +{{- if hasKey . "reclaimPolicy" }} +reclaimPolicy: {{ .reclaimPolicy }} +{{- end }} +{{- with .parameters }} +parameters: +{{ toYaml . | indent 2 }} +{{- end }} +{{- end }} diff --git a/charts/aws-ebs-csi-driver/values.yaml b/charts/aws-ebs-csi-driver/values.yaml index 4316108e31..c78e0da251 100644 --- a/charts/aws-ebs-csi-driver/values.yaml +++ b/charts/aws-ebs-csi-driver/values.yaml @@ -101,3 +101,13 @@ serviceAccount: create: true name: ebs-snapshot-controller annotations: {} + +storageClasses: [] +# Add StorageClass resources like: +# - name: ebs-sc +# # defaults to WaitForFirstConsumer +# volumeBindingMode: WaitForFirstConsumer +# # defaults to Delete +# reclaimPolicy: Retain +# parameters: +# encrypted: "true"