{{- if .Values.persistence.enabled }} apiVersion: v1 kind: PersistentVolumeClaim metadata: name: data annotations: "helm.sh/hook": pre-install,pre-upgrade "helm.sh/hook-weight": "-10" spec: accessModes: - {{ .Values.persistence.accessMode }} resources: requests: storage: {{ .Values.persistence.size }} {{- if .Values.persistence.storageClass }} {{- if (eq "-" .Values.persistence.storageClass) }} storageClassName: "" {{- else }} storageClassName: "{{ .Values.persistence.storageClass }}" {{- end }} {{- end }} {{- end }}