{{- if .Values.postgres.storage.enabled }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ include "janus-backstage.postgresql.name" . }}
  labels:
    {{- include "janus-backstage.postgresql.labels" . | nindent 4 }}
  annotations:
    kubernetes.io/reclaimPolicy: Delete 
spec:
{{- if .Values.postgres.storage.storageClass }}
  storageClassName: "{{ .Values.postgres.storage.storageClass }}"
{{- end }}
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.postgres.storage.size }}
{{- end }}
