blob: 91be5801f05924d23e8c8eee76b5ca72160be8d3 [file] [log] [blame]
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +04001{{- if or (and .Values.controller.autoscaling.enabled (gt (.Values.controller.autoscaling.minReplicas | int) 1)) (and (not .Values.controller.autoscaling.enabled) (gt (.Values.controller.replicaCount | int) 1)) }}
2apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version) }}
3kind: PodDisruptionBudget
4metadata:
5 labels:
6 {{- include "ingress-nginx.labels" . | nindent 4 }}
7 app.kubernetes.io/component: controller
Giorgi Lekveishvilicccf72f2023-05-19 16:13:22 +04008 {{- with .Values.controller.labels }}
9 {{- toYaml . | nindent 4 }}
10 {{- end }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040011 name: {{ include "ingress-nginx.controller.fullname" . }}
12 namespace: {{ .Release.Namespace }}
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +040013 {{- if .Values.controller.annotations }}
14 annotations: {{ toYaml .Values.controller.annotations | nindent 4 }}
15 {{- end }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040016spec:
17 selector:
18 matchLabels:
19 {{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
20 app.kubernetes.io/component: controller
Giorgi Lekveishvili0048a782023-06-20 18:32:21 +040021 {{- if and .Values.controller.minAvailable (not (hasKey .Values.controller "maxUnavailable")) }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040022 minAvailable: {{ .Values.controller.minAvailable }}
Giorgi Lekveishvilicccf72f2023-05-19 16:13:22 +040023 {{- else if .Values.controller.maxUnavailable }}
24 maxUnavailable: {{ .Values.controller.maxUnavailable }}
25 {{- end }}
Giorgi Lekveishvili725bb392023-05-05 18:24:27 +040026{{- end }}