{{- if .Values.persistence.data.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "nominatim.dataPvcName" . }}
  namespace: {{ .Values.global.namespace }}
  labels:
    {{- include "nominatim.labels" . | nindent 4 }}
spec:
  accessModes:
    - {{ .Values.persistence.data.accessMode }}
  resources:
    requests:
      storage: {{ .Values.persistence.data.size }}
  {{- if .Values.persistence.data.storageClassName }}
  storageClassName: {{ .Values.persistence.data.storageClassName }}
  {{- end }}
{{- end }}
---
{{- if .Values.persistence.flatnode.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "nominatim.flatnodePvcName" . }}
  namespace: {{ .Values.global.namespace }}
  labels:
    {{- include "nominatim.labels" . | nindent 4 }}
spec:
  accessModes:
    - {{ .Values.persistence.flatnode.accessMode }}
  resources:
    requests:
      storage: {{ .Values.persistence.flatnode.size }}
  {{- if .Values.persistence.flatnode.storageClassName }}
  storageClassName: {{ .Values.persistence.flatnode.storageClassName }}
  {{- end }}
{{- end }}
