3 SPDX-License-Identifier: APACHE-2.0
6 {{- if eq .Values.architecture "replicaset" }}
7 {{- $replicaCount := int .Values.replicaCount }}
8 {{- $loadBalancerIPListLength := len .Values.externalAccess.service.loadBalancerIPs }}
9 {{- if not (and .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $loadBalancerIPListLength )) (eq .Values.externalAccess.service.type "LoadBalancer")) }}
10 apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
13 name: {{ include "mongodb.fullname" . }}
14 namespace: {{ include "mongodb.namespace" . | quote }}
15 {{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.labels .Values.commonLabels ) "context" . ) }}
16 labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
17 app.kubernetes.io/component: mongodb
18 {{- if or .Values.annotations .Values.commonAnnotations }}
19 {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.annotations .Values.commonAnnotations ) "context" . ) }}
20 annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
23 serviceName: {{ include "mongodb.service.nameOverride" . }}
24 podManagementPolicy: {{ .Values.podManagementPolicy }}
25 replicas: {{ .Values.replicaCount }}
26 {{- if .Values.updateStrategy }}
27 updateStrategy: {{- toYaml .Values.updateStrategy | nindent 4 }}
29 {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
31 matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
32 app.kubernetes.io/component: mongodb
35 labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }}
36 app.kubernetes.io/component: mongodb
37 {{- if or (include "mongodb.createConfigmap" .) .Values.podAnnotations }}
39 {{- if (include "mongodb.createConfigmap" .) }}
40 checksum/configuration: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
42 {{- if .Values.podAnnotations }}
43 {{- include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
47 {{- include "mongodb.imagePullSecrets" . | nindent 6 }}
48 {{- if .Values.schedulerName }}
49 schedulerName: {{ .Values.schedulerName | quote }}
51 serviceAccountName: {{ template "mongodb.serviceAccountName" . }}
52 automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
53 {{- if .Values.hostAliases }}
54 hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
56 {{- if .Values.affinity }}
57 affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }}
60 podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "mongodb" "customLabels" $podLabels "topologyKey" .Values.topologyKey "context" $) | nindent 10 }}
61 podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "mongodb" "customLabels" $podLabels "topologyKey" .Values.topologyKey "context" $) | nindent 10 }}
62 nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
64 {{- if .Values.nodeSelector }}
65 nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
67 {{- if .Values.tolerations }}
68 tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
70 {{- if .Values.topologySpreadConstraints }}
71 topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" $) | nindent 8 }}
73 {{- if .Values.priorityClassName }}
74 priorityClassName: {{ .Values.priorityClassName }}
76 {{- if .Values.runtimeClassName }}
77 runtimeClassName: {{ .Values.runtimeClassName }}
79 {{- if .Values.podSecurityContext.enabled }}
80 securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
82 {{ if .Values.terminationGracePeriodSeconds }}
83 terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
85 enableServiceLinks: {{ .Values.enableServiceLinks }}
86 {{- if or .Values.initContainers (and .Values.volumePermissions.enabled .Values.persistence.enabled) (and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled) .Values.tls.enabled }}
88 {{- if .Values.initContainers }}
89 {{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
91 {{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
92 - name: volume-permissions
93 image: {{ include "mongodb.volumePermissions.image" . }}
94 imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
100 mkdir -p {{ printf "%s/%s" .Values.persistence.mountPath (default "" .Values.persistence.subPath) }}
101 chown {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} {{ printf "%s/%s" .Values.persistence.mountPath (default "" .Values.persistence.subPath) }}
102 find {{ printf "%s/%s" .Values.persistence.mountPath (default "" .Values.persistence.subPath) }} -mindepth 1 -maxdepth 1 -not -name ".snapshot" -not -name "lost+found" | xargs -r chown -R {{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }}
103 {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }}
104 securityContext: {{- omit .Values.volumePermissions.securityContext "runAsUser" | toYaml | nindent 12 }}
106 securityContext: {{- .Values.volumePermissions.securityContext | toYaml | nindent 12 }}
108 {{- if .Values.volumePermissions.resources }}
109 resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
110 {{- else if ne .Values.volumePermissions.resourcesPreset "none" }}
111 resources: {{- include "common.resources.preset" (dict "type" .Values.volumePermissions.resourcesPreset) | nindent 12 }}
115 mountPath: {{ .Values.persistence.mountPath }}
120 {{- if .Values.tls.enabled }}
121 - name: generate-tls-certs
122 image: {{ include "mongodb.tls.image" . }}
123 imagePullPolicy: {{ .Values.tls.image.pullPolicy | quote }}
125 - name: MY_POD_NAMESPACE
128 fieldPath: metadata.namespace
129 - name: MY_POD_HOST_IP
132 fieldPath: status.hostIP
136 fieldPath: metadata.name
138 {{- if (include "mongodb.autoGenerateCerts" .) }}
140 mountPath: /certs/CAs
142 {{- range $index, $_ := .Values.tls.replicaset.existingSecrets }}
143 - name: mongodb-certs-{{ $index }}
144 mountPath: /certs-{{ $index }}
149 - name: common-scripts
150 mountPath: /bitnami/scripts
155 - /bitnami/scripts/generate-certs.sh
157 - -s {{ include "mongodb.service.nameOverride" . }}
158 {{- if .Values.externalAccess.service.loadBalancerIPs }}
159 - -i {{ join "," .Values.externalAccess.service.loadBalancerIPs }}
161 {{- if .Values.tls.extraDnsNames }}
162 - -n {{ join "," .Values.tls.extraDnsNames }}
164 {{- if .Values.tls.resources }}
165 resources: {{- toYaml .Values.tls.resources | nindent 12 }}
166 {{- else if ne .Values.tls.resourcesPreset "none" }}
167 resources: {{- include "common.resources.preset" (dict "type" .Values.tls.resourcesPreset) | nindent 12 }}
170 {{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled (eq .Values.externalAccess.service.type "LoadBalancer") }}
171 - name: auto-discovery
172 image: {{ include "mongodb.externalAccess.autoDiscovery.image" . }}
173 imagePullPolicy: {{ .Values.externalAccess.autoDiscovery.image.pullPolicy | quote }}
174 # We need the service account token for contacting the k8s API
175 automountServiceAccountToken: true
177 - /scripts/auto-discovery.sh
182 fieldPath: metadata.name
184 value: "/shared/info.txt"
185 {{- if .Values.externalAccess.autoDiscovery.resources }}
186 resources: {{- toYaml .Values.externalAccess.autoDiscovery.resources | nindent 12 }}
187 {{- else if ne .Values.externalAccess.autoDiscovery.resourcesPreset "none" }}
188 resources: {{- include "common.resources.preset" (dict "type" .Values.externalAccess.autoDiscovery.resourcesPreset) | nindent 12 }}
194 mountPath: /scripts/auto-discovery.sh
195 subPath: auto-discovery.sh
203 image: {{ include "mongodb.image" . }}
204 imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
205 {{- if .Values.containerSecurityContext.enabled }}
206 securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
208 {{- if .Values.diagnosticMode.enabled }}
209 command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
210 {{- else if .Values.command }}
211 command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
216 {{- if .Values.diagnosticMode.enabled }}
217 args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
218 {{- else if .Values.args }}
219 args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }}
221 {{- if .Values.lifecycleHooks }}
222 lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }}
225 - name: BITNAMI_DEBUG
226 value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
227 {{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled (eq .Values.externalAccess.service.type "LoadBalancer") }}
229 value: "/shared/info.txt"
234 fieldPath: metadata.name
235 - name: MY_POD_NAMESPACE
238 fieldPath: metadata.namespace
239 - name: MY_POD_HOST_IP
242 fieldPath: status.hostIP
243 - name: K8S_SERVICE_NAME
244 value: "{{ include "mongodb.service.nameOverride" . }}"
245 - name: MONGODB_INITIAL_PRIMARY_HOST
246 value: {{ printf "%s-0.$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.%s" (include "mongodb.fullname" .) .Values.clusterDomain }}
247 - name: MONGODB_REPLICA_SET_NAME
248 value: {{ .Values.replicaSetName | quote }}
249 {{- if and .Values.replicaSetHostnames (not .Values.externalAccess.enabled) }}
250 - name: MONGODB_ADVERTISED_HOSTNAME
251 value: "$(MY_POD_NAME).$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.{{ .Values.clusterDomain }}"
253 {{- $customUsers := include "mongodb.customUsers" . -}}
254 {{- $customDatabases := include "mongodb.customDatabases" . -}}
255 {{- if not (empty $customUsers) }}
256 - name: MONGODB_EXTRA_USERNAMES
257 value: {{ $customUsers | quote }}
259 {{- if not (empty $customDatabases) }}
260 - name: MONGODB_EXTRA_DATABASES
261 value: {{ $customDatabases | quote }}
263 {{- if .Values.auth.enabled }}
264 {{- if and (not (empty $customUsers)) (not (empty $customDatabases)) }}
265 - name: MONGODB_EXTRA_PASSWORDS
268 name: {{ include "mongodb.secretName" . }}
269 key: mongodb-passwords
271 - name: MONGODB_ROOT_USER
272 value: {{ .Values.auth.rootUser | quote }}
273 - name: MONGODB_ROOT_PASSWORD
276 name: {{ include "mongodb.secretName" . }}
277 key: mongodb-root-password
278 - name: MONGODB_REPLICA_SET_KEY
281 name: {{ include "mongodb.secretName" . }}
282 key: mongodb-replica-set-key
284 {{- if and .Values.metrics.enabled (not (empty .Values.metrics.username)) }}
285 - name: MONGODB_METRICS_USERNAME
286 value: {{ .Values.metrics.username | quote }}
287 {{- if .Values.auth.enabled }}
288 - name: MONGODB_METRICS_PASSWORD
291 name: {{ include "mongodb.secretName" . }}
292 key: mongodb-metrics-password
295 - name: ALLOW_EMPTY_PASSWORD
296 value: {{ ternary "no" "yes" .Values.auth.enabled | quote }}
297 - name: MONGODB_SYSTEM_LOG_VERBOSITY
298 value: {{ .Values.systemLogVerbosity | quote }}
299 - name: MONGODB_DISABLE_SYSTEM_LOG
300 value: {{ ternary "yes" "no" .Values.disableSystemLog | quote }}
301 - name: MONGODB_DISABLE_JAVASCRIPT
302 value: {{ ternary "yes" "no" .Values.disableJavascript | quote }}
303 - name: MONGODB_ENABLE_JOURNAL
304 value: {{ ternary "yes" "no" .Values.enableJournal | quote }}
305 - name: MONGODB_PORT_NUMBER
306 value: {{ .Values.containerPorts.mongodb | quote }}
307 - name: MONGODB_ENABLE_IPV6
308 value: {{ ternary "yes" "no" .Values.enableIPv6 | quote }}
309 - name: MONGODB_ENABLE_DIRECTORY_PER_DB
310 value: {{ ternary "yes" "no" .Values.directoryPerDB | quote }}
311 {{- $extraFlags := .Values.extraFlags | join " " -}}
312 {{- if .Values.tls.enabled }}
313 {{- if .Values.tls.mTLS.enabled }}
314 {{- $extraFlags = printf "--tlsCAFile=/certs/mongodb-ca-cert %s" $extraFlags }}
316 {{- $extraFlags = printf "--tlsMode=%s --tlsCertificateKeyFile=/certs/mongodb.pem %s" .Values.tls.mode $extraFlags }}
318 {{- if ne $extraFlags "" }}
319 - name: MONGODB_EXTRA_FLAGS
320 value: {{ $extraFlags | quote }}
322 {{- if .Values.tls.enabled }}
323 - name: MONGODB_CLIENT_EXTRA_FLAGS
324 value: --tls {{ if .Values.tls.mTLS.enabled }}--tlsCertificateKeyFile=/certs/mongodb.pem {{ end }}--tlsCAFile=/certs/mongodb-ca-cert
326 {{- if .Values.extraEnvVars }}
327 {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
329 {{- if or .Values.extraEnvVarsCM .Values.extraEnvVarsSecret }}
331 {{- if .Values.extraEnvVarsCM }}
333 name: {{ tpl .Values.extraEnvVarsCM . | quote }}
335 {{- if .Values.extraEnvVarsSecret }}
337 name: {{ tpl .Values.extraEnvVarsSecret . | quote }}
342 containerPort: {{ .Values.containerPorts.mongodb }}
343 {{- if not .Values.diagnosticMode.enabled }}
344 {{- if .Values.customLivenessProbe }}
345 livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
346 {{- else if .Values.livenessProbe.enabled }}
347 livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }}
350 - /bitnami/scripts/ping-mongodb.sh
352 {{- if .Values.customReadinessProbe }}
353 readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
354 {{- else if .Values.readinessProbe.enabled }}
355 readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }}
358 - /bitnami/scripts/readiness-probe.sh
360 {{- if .Values.customStartupProbe }}
361 startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }}
362 {{- else if .Values.startupProbe.enabled }}
363 startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }}
366 - /bitnami/scripts/startup-probe.sh
369 {{- if .Values.resources }}
370 resources: {{- toYaml .Values.resources | nindent 12 }}
371 {{- else if ne .Values.resourcesPreset "none" }}
372 resources: {{- include "common.resources.preset" (dict "type" .Values.resourcesPreset) | nindent 12 }}
379 mountPath: /opt/bitnami/mongodb/conf
380 subPath: app-conf-dir
382 mountPath: /opt/bitnami/mongodb/tmp
385 mountPath: /opt/bitnami/mongodb/logs
386 subPath: app-logs-dir
388 mountPath: {{ .Values.persistence.mountPath }}
389 subPath: {{ .Values.persistence.subPath }}
390 - name: common-scripts
391 mountPath: /bitnami/scripts
392 {{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
393 - name: custom-init-scripts
394 mountPath: /docker-entrypoint-initdb.d
396 {{- if or .Values.configuration .Values.existingConfigmap }}
398 mountPath: /opt/bitnami/mongodb/conf/mongodb.conf
399 subPath: mongodb.conf
402 mountPath: /scripts/setup.sh
404 {{ if .Values.replicaSetConfigurationSettings.enabled }}
406 mountPath: /scripts/replicaSetConfigurationSettings.sh
407 subPath: replicaSetConfigurationSettings.sh
409 {{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled (eq .Values.externalAccess.service.type "LoadBalancer") }}
413 {{- if .Values.tls.enabled }}
417 {{- if .Values.extraVolumeMounts }}
418 {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
420 {{- if .Values.metrics.enabled }}
422 image: {{ template "mongodb.metrics.image" . }}
423 imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
424 {{- if .Values.containerSecurityContext.enabled }}
425 securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
427 {{- if .Values.diagnosticMode.enabled }}
428 command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
429 {{- else if .Values.metrics.command }}
430 command: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.command "context" $) | nindent 12 }}
436 {{- if .Values.diagnosticMode.enabled }}
437 args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
438 {{- else if .Values.metrics.args }}
439 args: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.args "context" $) | nindent 12 }}
443 /bin/mongodb_exporter {{ include "mongodb.exporterArgs" $ }} --mongodb.direct-connect --mongodb.global-conn-pool --web.listen-address ":{{ .Values.metrics.containerPort }}" --mongodb.uri "{{ include "mongodb.mongodb_exporter.uri" . }}" {{ .Values.metrics.extraFlags }}
446 {{- if .Values.auth.enabled }}
447 {{- if not .Values.metrics.username }}
448 - name: MONGODB_ROOT_USER
449 value: {{ .Values.auth.rootUser | quote }}
450 - name: MONGODB_ROOT_PASSWORD
453 name: {{ include "mongodb.secretName" . }}
454 key: mongodb-root-password
456 - name: MONGODB_METRICS_USERNAME
457 value: {{ .Values.metrics.username | quote }}
458 - name: MONGODB_METRICS_PASSWORD
461 name: {{ include "mongodb.secretName" . }}
462 key: mongodb-metrics-password
469 {{- if .Values.tls.enabled }}
473 {{- if .Values.metrics.extraVolumeMounts }}
474 {{- include "common.tplvalues.render" (dict "value" .Values.metrics.extraVolumeMounts "context" $) | nindent 12 }}
478 containerPort: {{ .Values.metrics.containerPort }}
479 {{- if not .Values.diagnosticMode.enabled }}
480 {{- if .Values.metrics.customLivenessProbe }}
481 livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
482 {{- else if .Values.metrics.livenessProbe.enabled }}
483 livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
488 {{- if .Values.metrics.customReadinessProbe }}
489 readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
490 {{- else if .Values.metrics.readinessProbe.enabled }}
491 readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
496 {{- if .Values.metrics.customStartupProbe }}
497 startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customStartupProbe "context" $) | nindent 12 }}
498 {{- else if .Values.metrics.startupProbe.enabled }}
499 startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
504 {{- if .Values.metrics.resources }}
505 resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
506 {{- else if ne .Values.metrics.resourcesPreset "none" }}
507 resources: {{- include "common.resources.preset" (dict "type" .Values.metrics.resourcesPreset) | nindent 12 }}
510 {{- if .Values.sidecars }}
511 {{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
516 - name: common-scripts
518 name: {{ printf "%s-common-scripts" (include "mongodb.fullname" .) }}
520 {{- if or .Values.initdbScriptsConfigMap .Values.initdbScripts }}
521 - name: custom-init-scripts
523 name: {{ template "mongodb.initdbScriptsCM" . }}
525 {{- if or .Values.configuration .Values.existingConfigmap }}
528 name: {{ include "mongodb.configmapName" . }}
530 {{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled (eq .Values.externalAccess.service.type "LoadBalancer") }}
536 name: {{ printf "%s-scripts" (include "mongodb.fullname" .) }}
538 {{- if .Values.extraVolumes }}
539 {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
541 {{- if .Values.tls.enabled }}
544 {{- if (include "mongodb.autoGenerateCerts" .) }}
547 secretName: {{ template "mongodb.tlsSecretName" . }}
549 - key: mongodb-ca-cert
550 path: mongodb-ca-cert
552 - key: mongodb-ca-key
556 {{- range $index, $secret := .Values.tls.replicaset.existingSecrets }}
557 - name: mongodb-certs-{{ $index }}
559 secretName: {{ include "common.tplvalues.render" ( dict "value" $secret "context" $) }}
564 {{- if not .Values.persistence.enabled }}
566 {{- if .Values.persistence.medium }}
568 medium: {{ .Values.persistence.medium | quote }}
573 {{- if .Values.persistentVolumeClaimRetentionPolicy.enabled }}
574 persistentVolumeClaimRetentionPolicy:
575 whenDeleted: {{ .Values.persistentVolumeClaimRetentionPolicy.whenDeleted }}
576 whenScaled: {{ .Values.persistentVolumeClaimRetentionPolicy.whenScaled }}
578 volumeClaimTemplates:
580 kind: PersistentVolumeClaim
583 {{- if .Values.persistence.annotations }}
584 annotations: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
588 {{- range .Values.persistence.accessModes }}
593 storage: {{ .Values.persistence.size | quote }}
594 {{- if .Values.persistence.volumeClaimTemplates.requests }}
595 {{- include "common.tplvalues.render" (dict "value" .Values.persistence.volumeClaimTemplates.requests "context" $) | nindent 12 }}
597 {{- if .Values.persistence.volumeClaimTemplates.dataSource }}
598 dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.volumeClaimTemplates.dataSource "context" $) | nindent 10 }}
600 {{- if .Values.persistence.volumeClaimTemplates.selector }}
601 selector: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.volumeClaimTemplates.selector "context" $) | nindent 10 }}
603 {{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }}