{{- if .Values.server.persistentVolume.enabled -}}
{{- if not .Values.server.statefulSet.enabled -}}
{{- if not .Values.server.persistentVolume.existingClaim -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ template "victoria-metrics.server.fullname" . }}
  namespace: {{ .Release.Namespace }}
{{- with .Values.server.persistentVolume.annotations  }}
  annotations:
{{ toYaml . | indent 4 }}
{{- end }}
  labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
spec:
{{- with .Values.server.persistentVolume.accessModes }}
  accessModes:
{{ toYaml . | indent 4 }}
{{- end }}
  resources:
    requests:
      storage: {{ .Values.server.persistentVolume.size | quote }}
{{- if .Values.server.persistentVolume.storageClass }}
  storageClassName: {{ .Values.server.persistentVolume.storageClass | quote }}
{{- end }}
{{- with .Values.server.persistentVolume.matchLabels }}
  selector:
    matchLabels:
      {{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
