blob: 91250677fa7bc71e895db98a17c02dbc01b9f805 [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 (include "mongodb.hidden.enabled" .) .Values.hidden.pdb.create }}
7apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
8kind: PodDisruptionBudget
9metadata:
10 name: {{ printf "%s-hidden" (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: hidden
14 {{- if .Values.commonAnnotations }}
15 annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
16 {{- end }}
17spec:
18 {{- if .Values.hidden.pdb.minAvailable }}
19 minAvailable: {{ .Values.hidden.pdb.minAvailable }}
20 {{- end }}
21 {{- if or .Values.hidden.pdb.maxUnavailable (not .Values.hidden.pdb.minAvailable) }}
22 maxUnavailable: {{ .Values.hidden.pdb.maxUnavailable | default 1 }}
23 {{- end }}
24 {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.hidden.podLabels .Values.commonLabels ) "context" . ) }}
25 selector:
26 matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
27 app.kubernetes.io/component: hidden
28{{- end }}