{{- if .Values.nfs.enabled -}}
apiVersion: v1
kind: PersistentVolume
metadata:
  name: {{ include "vhaudiquet-fr.fullname" . }}-public
  labels:
    {{- include "vhaudiquet-fr.labels" . | nindent 4 }}
spec:
  capacity:
    storage: {{ .Values.nfs.storageSize }}
  accessModes:
    - ReadOnlyMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: {{ .Values.nfs.storageClassName | default (printf "%s-nfs" (include "vhaudiquet-fr.fullname" .)) }}
  nfs:
    server: {{ .Values.nfs.server | required "nfs.server is required when nfs.enabled is true" }}
    path: {{ .Values.nfs.path }}
{{- end }}
