| gio | 07eb108 | 2024-10-25 14:35:56 +0400 | [diff] [blame] | 1 | {{- /* |
| 2 | Copyright Broadcom, Inc. All Rights Reserved. |
| 3 | SPDX-License-Identifier: APACHE-2.0 |
| 4 | */}} |
| 5 | |
| 6 | {{- if and .Values.backup.enabled (not .Values.backup.cronjob.storage.existingClaim) -}} |
| 7 | apiVersion: v1 |
| 8 | kind: PersistentVolumeClaim |
| 9 | metadata: |
| 10 | name: {{ include "mongodb.fullname" . }}-mongodump |
| 11 | namespace: {{ include "mongodb.namespace" . | quote }} |
| 12 | labels: {{- include "common.labels.standard" . | nindent 4 }} |
| 13 | app.kubernetes.io/component: mongodump |
| 14 | {{- if .Values.backup.cronjob.labels }} |
| 15 | {{- include "common.tplvalues.render" (dict "value" .Values.backup.cronjob.labels "context" $) | nindent 4 }} |
| 16 | {{- end }} |
| 17 | {{- if .Values.commonLabels }} |
| 18 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} |
| 19 | {{- end }} |
| 20 | {{- if or .Values.backup.cronjob.annotations .Values.commonAnnotations .Values.backup.cronjob.storage.resourcePolicy}} |
| 21 | annotations: |
| 22 | {{- if .Values.backup.cronjob.annotations }} |
| 23 | {{- include "common.tplvalues.render" ( dict "value" .Values.backup.cronjob.annotations "context" $) | nindent 4 }} |
| 24 | {{- end }} |
| 25 | {{- if .Values.commonAnnotations }} |
| 26 | {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} |
| 27 | {{- end }} |
| 28 | {{- if .Values.backup.cronjob.storage.resourcePolicy }} |
| 29 | helm.sh/resource-policy: {{ .Values.backup.cronjob.storage.resourcePolicy | quote }} |
| 30 | {{- end }} |
| 31 | {{- end }} |
| 32 | spec: |
| 33 | accessModes: |
| 34 | {{- range .Values.backup.cronjob.storage.accessModes }} |
| 35 | - {{ . | quote }} |
| 36 | {{- end }} |
| 37 | resources: |
| 38 | requests: |
| 39 | storage: {{ .Values.backup.cronjob.storage.size | quote }} |
| 40 | {{ include "common.storage.class" (dict "persistence" .Values.backup.cronjob.storage "global" .Values.global) | nindent 2 }} |
| 41 | {{- end }} |