Add multi PV support to EFS

This commit is contained in:
Stefan Reimer 2020-10-09 07:30:25 -07:00
parent 54335c4c0a
commit 959d61ef66
5 changed files with 59 additions and 8 deletions

View File

@ -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:

View File

@ -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 | `"<efs-id>:/path"` | |
| PersistentVolumes[1].name | string | `"example-pv2"` | |
| PersistentVolumes[1].volumeHandle | string | `"<efs-id>:/path2"` | |
| StorageClass.create | bool | `true` | |
| StorageClass.default | bool | `false` | |
| aws-efs-csi-driver.nodeSelector | object | `{}` | |

View File

@ -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" . }}

View File

@ -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 }}

View File

@ -5,7 +5,20 @@ aws-efs-csi-driver:
StorageClass:
create: true
default: false
#PersistentVolumes:
# - name: example-pv
# mountOptions:
# - tls
# volumeHandle: "<efs-id>:/path"
# claimRef:
# name: foo-pvc
# namespace: foo
#
# - name: example-pv2
# volumeHandle: "<efs-id>:/path2"
# Deprecated and removed with next release
PersistentVolume:
create: false
EfsId: ""