{{- if index .Values "aws-efs-csi-driver" "enabled" }}
{{- range ( index .Values "aws-efs-csi-driver" "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 .volumeAttributes }}
    volumeAttributes:
      {{- . | toYaml | nindent 6 }}
    {{- end }}
  {{- with .claimRef }}
  claimRef:
  {{- . | toYaml | nindent 4 }}
  {{- end }}
---
{{- end }}
{{- end }}
