pvc.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. {{- /*
  2. Copyright VMware, Inc.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. {{- if and .Values.backup.enabled (not .Values.backup.cronjob.storage.existingClaim) -}}
  6. apiVersion: v1
  7. kind: PersistentVolumeClaim
  8. metadata:
  9. name: {{ include "postgresql.v1.primary.fullname" . }}-pgdumpall
  10. namespace: {{ .Release.Namespace | quote }}
  11. {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.backup.cronjob.labels .Values.commonLabels ) "context" . ) }}
  12. labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
  13. app.kubernetes.io/component: pg_dumpall
  14. {{- if or .Values.backup.cronjob.annotations .Values.commonAnnotations .Values.backup.cronjob.storage.resourcePolicy }}
  15. annotations:
  16. {{- if or .Values.backup.cronjob.annotations .Values.commonAnnotations }}
  17. {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.backup.cronjob.annotations .Values.commonAnnotations ) "context" . ) }}
  18. {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
  19. {{- end }}
  20. {{- if .Values.backup.cronjob.storage.resourcePolicy }}
  21. helm.sh/resource-policy: {{ .Values.backup.cronjob.storage.resourcePolicy | quote }}
  22. {{- end }}
  23. {{- end }}
  24. spec:
  25. accessModes:
  26. {{- range .Values.backup.cronjob.storage.accessModes }}
  27. - {{ . | quote }}
  28. {{- end }}
  29. resources:
  30. requests:
  31. storage: {{ .Values.backup.cronjob.storage.size | quote }}
  32. {{ include "common.storage.class" (dict "persistence" .Values.backup.cronjob.storage "global" .Values.global) }}
  33. {{- end }}