-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Merged
k8s-ci-robot
merged 6 commits into
kubernetes:main
from
StuxxNet:feat/ISSUE-10083-add-pdb-when-keda-in-place
Mar 11, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
29c4237
feat: deploy PDB if Keda is enabled and the minimum amount of replica…
StuxxNet 5f194a7
feat: add the corresponding unit-test to check PDB deployment with Keda
StuxxNet 97a4f84
chore: rename the test of PDB to follow suggested pattern
StuxxNet b869ebc
chore: update the test-case suite name to the new format
StuxxNet 6480e14
Update charts/ingress-nginx/templates/controller-poddisruptionbudget.…
StuxxNet 17ee81c
Update charts/ingress-nginx/tests/controller-poddisruptionbudget_test…
StuxxNet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to add some docs for this?
What if the user enable both by mistake?
Can we try to use the OR instead or that does not work?
/hold for clarification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, yeah, I get your point. HPA and KEDA being mutually exclusive always was a problem and looking at the particular resource templates, we are not even preventing that in there.
So right now what you see above is pretty close the best we can get without making the conditions too complex and unreadable.
I created an issue for improving and aligning that everywhere. But for now, I'd just go on and merge this PR. Aligning all these conditions is out of scope here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the issue I created: #10814