---
{{- $pvcUsingTemplate := and .Values.persistence.enabled .Values.statefulSet.enabled (not .Values.persistence.existingClaim) (ne .Values.persistence.accessMode "ReadWriteMany")| ternary true false }}
{{- if and .Values.persistence.enabled (not $pvcUsingTemplate) (not .Values.persistence.existingClaim )}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ include "nim-llm.fullname" . }}
  labels:
    {{- include "nim-llm.labels" . | nindent 4 }}
  {{- with .Values.persistence.annotations  }}
  annotations:
    {{ toYaml . | indent 4 }}
  {{- end }}
spec:
  accessModes:
    - {{ .Values.persistence.accessMode | quote }}
  resources:
    requests:
      storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
  storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{ end }}
