-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> * Update charts/ingress-nginx/tests/controller-poddisruptionbudget_test.yaml Co-authored-by: Marco Ebert <[email protected]> --------- Co-authored-by: Marco Ebert <[email protected]>
- Loading branch information
Showing
2 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
8 changes: 7 additions & 1 deletion
8
charts/ingress-nginx/templates/controller-poddisruptionbudget.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
charts/ingress-nginx/tests/controller-poddisruptionbudget_test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
suite: Controller > PodDisruptionBudget | ||
templates: | ||
- controller-poddisruptionbudget.yaml | ||
|
||
tests: | ||
- it: should create a PodDisruptionBudget if `controller.replicaCount` is greater than 1 | ||
set: | ||
controller.replicaCount: 2 | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- isKind: | ||
of: PodDisruptionBudget | ||
- equal: | ||
path: metadata.name | ||
value: RELEASE-NAME-ingress-nginx-controller | ||
|
||
- it: should not create a PodDisruptionBudget if `controller.replicaCount` is less than or equal 1 | ||
set: | ||
controller.replicaCount: 1 | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
|
||
- it: should create a PodDisruptionBudget if `controller.autoscaling.enabled` is true and `controller.autoscaling.minReplicas` is greater than 1 | ||
set: | ||
controller.autoscaling.enabled: true | ||
controller.autoscaling.minReplicas: 2 | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- isKind: | ||
of: PodDisruptionBudget | ||
- equal: | ||
path: metadata.name | ||
value: RELEASE-NAME-ingress-nginx-controller | ||
|
||
- it: should not create a PodDisruptionBudget if `controller.autoscaling.enabled` is true and `controller.autoscaling.minReplicas` is less than or equal 1 | ||
set: | ||
controller.autoscaling.enabled: true | ||
controller.autoscaling.minReplicas: 1 | ||
asserts: | ||
- hasDocuments: | ||
count: 0 | ||
|
||
- it: should create a PodDisruptionBudget if `controller.keda.enabled` is true and `controller.keda.minReplicas` is greater than 1 | ||
set: | ||
controller.keda.enabled: true | ||
controller.keda.minReplicas: 2 | ||
asserts: | ||
- hasDocuments: | ||
count: 1 | ||
- isKind: | ||
of: PodDisruptionBudget | ||
- equal: | ||
path: metadata.name | ||
value: RELEASE-NAME-ingress-nginx-controller | ||
|
||
- it: should not create a PodDisruptionBudget if `controller.keda.enabled` is true and `controller.keda.minReplicas` is less than or equal 1 | ||
set: | ||
controller.keda.enabled: true | ||
controller.keda.minReplicas: 1 | ||
asserts: | ||
- hasDocuments: | ||
count: 0 |