Chart: Deploy PodDisruptionBudget with KEDA. (#11032)

* feat: deploy PDB if Keda is enabled and the minimum amount of replicas is greater than 1

* feat: add the corresponding unit-test to check PDB deployment with Keda

* chore: rename the test of PDB to follow suggested pattern

* chore: update the test-case suite name to the new format

* Update charts/ingress-nginx/templates/controller-poddisruptionbudget.yaml

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

* Update charts/ingress-nginx/tests/controller-poddisruptionbudget_test.yaml

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>

---------

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
Ramon Borges 2024-03-11 22:14:25 +01:00 committed by GitHub
parent 9c384c7eb8
commit b5c447612c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 72 additions and 1 deletions

View file

@ -1,4 +1,10 @@
{{- 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)) }}
{{- $replicas := .Values.controller.replicaCount }}
{{- if .Values.controller.autoscaling.enabled }}
{{- $replicas = .Values.controller.autoscaling.minReplicas }}
{{- else if .Values.controller.keda.enabled }}
{{- $replicas = .Values.controller.keda.minReplicas }}
{{- end }}
{{- if gt ($replicas | int) 1 }}
apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version) }}
kind: PodDisruptionBudget
metadata: