Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart: Deploy PodDisruptionBudget with KEDA. #11032

@@ -1,4 +1,4 @@
{{- 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)) }}
{{- 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)) (and .Values.controller.keda.enabled (gt (.Values.controller.keda.minReplicas | int) 1))}}
StuxxNet marked this conversation as resolved.
Show resolved Hide resolved
apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version) }}
kind: PodDisruptionBudget
metadata:
Expand Down
@@ -0,0 +1,22 @@
suite: Controller > PodDisruptionBudget
templates:
- controller-poddisruptionbudget.yaml

tests:
- it: should create a PodDisruptionBudget if `controller.kind` is "Deployment" and `controller.keda.enabled` is true
set:
controller.kind: Deployment
controller.keda.enabled: true
controller.keda.minReplicas: 2
controller.minAvailable: 1
asserts:
- hasDocuments:
count: 1
- isKind:
of: PodDisruptionBudget
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
- equal:
path: spec.minAvailable
value: 1
StuxxNet marked this conversation as resolved.
Show resolved Hide resolved