| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 1 | {{- 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)) }} |
| 2 | apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version) }} |
| 3 | kind: PodDisruptionBudget |
| 4 | metadata: |
| 5 | labels: |
| 6 | {{- include "ingress-nginx.labels" . | nindent 4 }} |
| 7 | app.kubernetes.io/component: controller |
| Giorgi Lekveishvili | cccf72f | 2023-05-19 16:13:22 +0400 | [diff] [blame] | 8 | {{- with .Values.controller.labels }} |
| 9 | {{- toYaml . | nindent 4 }} |
| 10 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 11 | name: {{ include "ingress-nginx.controller.fullname" . }} |
| 12 | namespace: {{ .Release.Namespace }} |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 13 | {{- if .Values.controller.annotations }} |
| 14 | annotations: {{ toYaml .Values.controller.annotations | nindent 4 }} |
| 15 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 16 | spec: |
| 17 | selector: |
| 18 | matchLabels: |
| 19 | {{- include "ingress-nginx.selectorLabels" . | nindent 6 }} |
| 20 | app.kubernetes.io/component: controller |
| Giorgi Lekveishvili | 0048a78 | 2023-06-20 18:32:21 +0400 | [diff] [blame] | 21 | {{- if and .Values.controller.minAvailable (not (hasKey .Values.controller "maxUnavailable")) }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 22 | minAvailable: {{ .Values.controller.minAvailable }} |
| Giorgi Lekveishvili | cccf72f | 2023-05-19 16:13:22 +0400 | [diff] [blame] | 23 | {{- else if .Values.controller.maxUnavailable }} |
| 24 | maxUnavailable: {{ .Values.controller.maxUnavailable }} |
| 25 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 26 | {{- end }} |