From 959d61ef662ea6b3bda7aef6f37cecd4ed60d0dc Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Fri, 9 Oct 2020 07:30:25 -0700 Subject: [PATCH] Add multi PV support to EFS --- charts/kubezero-aws-efs-csi-driver/Chart.yaml | 4 +-- charts/kubezero-aws-efs-csi-driver/README.md | 17 +++++++---- .../README.md.gotmpl | 3 ++ .../templates/efs_pvs.yaml | 28 +++++++++++++++++++ .../kubezero-aws-efs-csi-driver/values.yaml | 15 +++++++++- 5 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 charts/kubezero-aws-efs-csi-driver/templates/efs_pvs.yaml diff --git a/charts/kubezero-aws-efs-csi-driver/Chart.yaml b/charts/kubezero-aws-efs-csi-driver/Chart.yaml index 57809d31..0f33cdb0 100644 --- a/charts/kubezero-aws-efs-csi-driver/Chart.yaml +++ b/charts/kubezero-aws-efs-csi-driver/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v2 name: kubezero-aws-efs-csi-driver description: KubeZero Umbrella Chart for aws-efs-csi-driver -version: 0.1.1 +version: 0.2.0 appVersion: 1.0.0 -kubeVersion: ">=1.16.0-0" +kubeVersion: ">=1.17.0-0" home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png sources: diff --git a/charts/kubezero-aws-efs-csi-driver/README.md b/charts/kubezero-aws-efs-csi-driver/README.md index ebe4307f..be2840ec 100644 --- a/charts/kubezero-aws-efs-csi-driver/README.md +++ b/charts/kubezero-aws-efs-csi-driver/README.md @@ -1,6 +1,6 @@ # kubezero-aws-efs-csi-driver -![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) +![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) KubeZero Umbrella Chart for aws-efs-csi-driver @@ -19,7 +19,7 @@ KubeZero Umbrella Chart for aws-efs-csi-driver ## Requirements -Kubernetes: `>=1.16.0-0` +Kubernetes: `>=1.17.0-0` | Repository | Name | Version | |------------|------|---------| @@ -29,13 +29,20 @@ Kubernetes: `>=1.16.0-0` Optionally creates the *efs-cs* storage class. Could also be made the default storage class if requested. +## Multiple PVs & PVCs backed by same EFS file system +Details also see: [Reserve PV](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) + ## Values | Key | Type | Default | Description | |-----|------|---------|-------------| -| PersistentVolume.EfsId | string | `""` | | -| PersistentVolume.Name | string | `""` | | -| PersistentVolume.create | bool | `false` | | +| PersistentVolumes[0].claimRef.name | string | `"foo-pvc"` | | +| PersistentVolumes[0].claimRef.namespace | string | `"foo"` | | +| PersistentVolumes[0].mountOptions[0] | string | `"tls"` | | +| PersistentVolumes[0].name | string | `"example-pv"` | | +| PersistentVolumes[0].volumeHandle | string | `":/path"` | | +| PersistentVolumes[1].name | string | `"example-pv2"` | | +| PersistentVolumes[1].volumeHandle | string | `":/path2"` | | | StorageClass.create | bool | `true` | | | StorageClass.default | bool | `false` | | | aws-efs-csi-driver.nodeSelector | object | `{}` | | diff --git a/charts/kubezero-aws-efs-csi-driver/README.md.gotmpl b/charts/kubezero-aws-efs-csi-driver/README.md.gotmpl index 72c8589a..45206edc 100644 --- a/charts/kubezero-aws-efs-csi-driver/README.md.gotmpl +++ b/charts/kubezero-aws-efs-csi-driver/README.md.gotmpl @@ -17,4 +17,7 @@ Optionally creates the *efs-cs* storage class. Could also be made the default storage class if requested. +## Multiple PVs & PVCs backed by same EFS file system +Details also see: [Reserve PV](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume) + {{ template "chart.valuesSection" . }} diff --git a/charts/kubezero-aws-efs-csi-driver/templates/efs_pvs.yaml b/charts/kubezero-aws-efs-csi-driver/templates/efs_pvs.yaml new file mode 100644 index 00000000..f7a6e88f --- /dev/null +++ b/charts/kubezero-aws-efs-csi-driver/templates/efs_pvs.yaml @@ -0,0 +1,28 @@ +{{- range .Values.PersistentVolumes }} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ default "kubezero-efs-pv" .name }} + labels: +{{ include "kubezero-lib.labels" $ | indent 4 }} +spec: + capacity: + storage: 5Gi + volumeMode: Filesystem + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: efs-sc + csi: + driver: efs.csi.aws.com + volumeHandle: {{ .volumeHandle }} + {{- with .mountOptions }} + mountOptions: + {{- . | toYaml | nindent 4 }} + {{- end }} + {{- with .claimRef }} + claimRef: + {{- . | toYaml | nindent 4 }} + {{- end }} +--- +{{- end }} diff --git a/charts/kubezero-aws-efs-csi-driver/values.yaml b/charts/kubezero-aws-efs-csi-driver/values.yaml index fe0cf551..8650a119 100644 --- a/charts/kubezero-aws-efs-csi-driver/values.yaml +++ b/charts/kubezero-aws-efs-csi-driver/values.yaml @@ -5,7 +5,20 @@ aws-efs-csi-driver: StorageClass: create: true default: false - + +#PersistentVolumes: +# - name: example-pv +# mountOptions: +# - tls +# volumeHandle: ":/path" +# claimRef: +# name: foo-pvc +# namespace: foo +# +# - name: example-pv2 +# volumeHandle: ":/path2" + +# Deprecated and removed with next release PersistentVolume: create: false EfsId: ""