blob: 2789136f9ffc64ec94daed632e047f8ed3a92964 [file] [log] [blame]
Giorgi Lekveishviliea328da2026-07-29 12:15:15 +04001{{- if .Values.webhook.podDisruptionBudget.enabled }}
2apiVersion: policy/v1
3kind: PodDisruptionBudget
4metadata:
5 name: {{ include "webhook.fullname" . }}
6 namespace: {{ include "cert-manager.namespace" . }}
7 labels:
8 app: {{ include "webhook.name" . }}
9 app.kubernetes.io/name: {{ include "webhook.name" . }}
10 app.kubernetes.io/instance: {{ .Release.Name }}
11 app.kubernetes.io/component: "webhook"
12 {{- include "labels" . | nindent 4 }}
13spec:
14 selector:
15 matchLabels:
16 app.kubernetes.io/name: {{ include "webhook.name" . }}
17 app.kubernetes.io/instance: {{ .Release.Name }}
18 app.kubernetes.io/component: "webhook"
19
20 {{- if not (or (hasKey .Values.webhook.podDisruptionBudget "minAvailable") (hasKey .Values.webhook.podDisruptionBudget "maxUnavailable")) }}
21 minAvailable: 1 # Default value because minAvailable and maxUnavailable are not set
22 {{- end }}
23 {{- if hasKey .Values.webhook.podDisruptionBudget "minAvailable" }}
24 minAvailable: {{ .Values.webhook.podDisruptionBudget.minAvailable }}
25 {{- end }}
26 {{- if hasKey .Values.webhook.podDisruptionBudget "maxUnavailable" }}
27 maxUnavailable: {{ .Values.webhook.podDisruptionBudget.maxUnavailable }}
28 {{- end }}
29 {{- with .Values.webhook.podDisruptionBudget.unhealthyPodEvictionPolicy }}
30 unhealthyPodEvictionPolicy: {{ . }}
31 {{- end }}
32{{- end }}