2021-05-30 20:16:25 +00:00
|
|
|
{{- 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)) }}
|
2021-08-05 12:23:22 +00:00
|
|
|
apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version) }}
|
2020-02-24 19:25:57 +00:00
|
|
|
kind: PodDisruptionBudget
|
|
|
|
metadata:
|
|
|
|
labels:
|
2020-02-28 14:53:24 +00:00
|
|
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
2020-03-04 02:53:23 +00:00
|
|
|
app.kubernetes.io/component: controller
|
2021-11-19 14:52:52 +00:00
|
|
|
{{- with .Values.controller.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-03-04 02:53:23 +00:00
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
2023-10-24 17:53:46 +00:00
|
|
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
2023-05-10 21:39:14 +00:00
|
|
|
{{- if .Values.controller.annotations }}
|
|
|
|
annotations: {{ toYaml .Values.controller.annotations | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-02-24 19:25:57 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2020-02-28 14:53:24 +00:00
|
|
|
{{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
|
2020-03-04 02:53:23 +00:00
|
|
|
app.kubernetes.io/component: controller
|
2023-05-25 17:26:53 +00:00
|
|
|
{{- if and .Values.controller.minAvailable (not (hasKey .Values.controller "maxUnavailable")) }}
|
2020-02-24 19:25:57 +00:00
|
|
|
minAvailable: {{ .Values.controller.minAvailable }}
|
2022-11-10 11:20:54 +00:00
|
|
|
{{- else if .Values.controller.maxUnavailable }}
|
|
|
|
maxUnavailable: {{ .Values.controller.maxUnavailable }}
|
|
|
|
{{- end }}
|
2020-02-24 19:25:57 +00:00
|
|
|
{{- end }}
|