blob: 16098580e68246a45717b83b2757d82f4a4e3394 [file] [log] [blame]
gio07eb1082024-10-25 14:35:56 +04001{{- /*
2Copyright Broadcom, Inc. All Rights Reserved.
3SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) (not (eq .Values.architecture "replicaset")) (not .Values.useStatefulSet) }}
7kind: PersistentVolumeClaim
8apiVersion: v1
9metadata:
10 name: {{ include "mongodb.fullname" . }}
11 namespace: {{ include "mongodb.namespace" . | quote }}
12 labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
13 app.kubernetes.io/component: mongodb
14 annotations:
15 {{- if .Values.persistence.resourcePolicy }}
16 helm.sh/resource-policy: {{ .Values.persistence.resourcePolicy | quote }}
17 {{- end }}
18 {{- if or .Values.persistence.annotations .Values.commonAnnotations }}
19 {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.persistence.annotations .Values.commonAnnotations ) "context" . ) }}
20 {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
21 {{- end }}
22spec:
23 accessModes:
24 {{- range .Values.persistence.accessModes }}
25 - {{ . | quote }}
26 {{- end }}
27 resources:
28 requests:
29 storage: {{ .Values.persistence.size | quote }}
30 {{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }}
31{{- end }}