{{- if and .Values.logIngest.enabled (hasKey .Values.logIngest "persistence") (.Values.logIngest.persistence.enabled) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: {{ .Release.Name }}-logs-pvc
  namespace: {{ .Release.Namespace }}
  labels:
    app.kubernetes.io/name: "central-storage"
    app.kubernetes.io/instance: {{ .Release.Name }}
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: {{ .Values.logIngest.persistence.size | default "1Gi" }}
  {{- if .Values.logIngest.persistence.storageClass }}
  storageClassName: {{ .Values.logIngest.persistence.storageClass }}
  {{- end }}
{{- end }} 