# helm_charts_pushgateway-pvc.yaml
{{- if .Values.persistentVolume.enabled -}}
{{- if not .Values.persistentVolume.existingClaim -}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  {{- if .Values.persistentVolume.annotations }}
  annotations:
{{ toYaml .Values.persistentVolume.annotations | indent 4 }}
  {{- end }}
  labels:
{{ template "prometheus-pushgateway.defaultLabels" merge (dict "extraLabels" .Values.persistentVolumeLabels) .  }}
  name: {{ template "prometheus-pushgateway.fullname" . }}
spec:
  accessModes:
{{ toYaml .Values.persistentVolume.accessModes | indent 4 }}
{{- if .Values.persistentVolume.storageClass }}
{{- if (eq "-" .Values.persistentVolume.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
  resources:
    requests:
      storage: "{{ .Values.persistentVolume.size }}"
{{- end -}}
{{- end -}}