Files
devops-infra-helm-charts-gcp/helm-templates/victoria-metrics-agent-latest/templates/pvc.yaml
T
2026-08-26 03:39:42 +05:30

34 lines
967 B
YAML

{{- $app := .Values }}
{{- $pvc := $app.persistentVolume }}
{{- if and $pvc.enabled (not $pvc.existingClaim) (eq $app.mode "deployment") }}
{{- $ctx := dict "helm" . }}
{{- $fullname := include "vm.fullname" $ctx }}
{{- $ns := include "vm.namespace" $ctx }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ tpl ($pvc.name | default $fullname) $ctx }}
namespace: {{ $ns }}
{{- $_ := set $ctx "extraLabels" $pvc.extraLabels }}
labels: {{ include "vm.labels" $ctx | nindent 4 }}
{{- $_ := unset $ctx "extraLabels" }}
{{- with $pvc.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with $pvc.accessModes }}
accessModes: {{ toYaml . | nindent 4 }}
{{- end }}
resources:
requests:
storage: {{ $pvc.size }}
{{- with $pvc.storageClassName }}
storageClassName: {{ . }}
{{- end -}}
{{- with $pvc.matchLabels }}
selector:
matchLabels: {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}