# helm_charts_acme-pvc.yaml
{{- if and .Values.acme.enabled .Values.acme.persistence.enabled (not .Values.acme.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
{{- if .Values.acme.persistence.annotations }}
  annotations:
{{ toYaml .Values.acme.persistence.annotations | indent 4 }}
{{- end }}
  name: {{ template "traefik.fullname" . }}-acme
  labels:
    app: {{ template "traefik.name" . }}
    chart: {{ template "traefik.chart" . }}
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
spec:
  accessModes:
    - {{ .Values.acme.persistence.accessMode | quote }}
  resources:
    requests:
      storage: {{ .Values.acme.persistence.size | quote }}
{{- if .Values.acme.persistence.storageClass }}
{{- if (eq "-" .Values.acme.persistence.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.acme.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}