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

helm: support PodDisruptionBudget for resources #3955

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

a7i
Copy link
Contributor

@a7i a7i commented Aug 18, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Currently there's not a way to render PodDisruptionBudget for critical resources such as kube-apiserver

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

helm: support PodDisruptionBudget for resources

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 18, 2023
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 18, 2023
@a7i a7i force-pushed the amir/helm-poddisruption-budget branch 2 times, most recently from 54100f9 to 9893be5 Compare August 18, 2023 20:15
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
@a7i a7i force-pushed the amir/helm-poddisruption-budget branch from 9893be5 to 823aeb3 Compare August 18, 2023 20:36
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/assign

Thanks @a7i I'll take a look ASAP.

Comment on lines +22 to +23
podDisruptionBudget: &podDisruptionBudget {}
# maxUnavailable: 20%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean all components will share the same budget?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each resource has its own podDisruptionBudget configuration which can get an override. This was following the existing pattern of karmadaImageVersion on line 20 but happy to remove the anchor tag if you suggest though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 22, 2023
@karmada-bot karmada-bot merged commit 9cea800 into karmada-io:master Aug 22, 2023
13 checks passed
@chaosi-zju
Copy link
Member

hello @a7i, thank you for your important commit! Though the PR is merged, I wanna to bother you some questions:

  1. you seems like added a empty PodDisruptionBudget config to chart template, why not add a config like minAvailable: 1? On the one hand it seems more meaningful, on the other hand it can provide a example to users, for users may not familiar with the format and rule of anchor.

  2. didn't you test it by local helm install, and in your testing how did you configured the value.yaml?

Thank you again~

@RainbowMango
Copy link
Member

why not add a config like minAvailable: 1? On the one hand it seems more meaningful,

I guess not all users need PDB, that's why take empty as default.

@a7i a7i deleted the amir/helm-poddisruption-budget branch August 22, 2023 16:28
@a7i
Copy link
Contributor Author

a7i commented Aug 22, 2023

  1. @RainbowMango is exactly right. If you have a single replica for example, minAvailable: 1 will block node rollout / cluster upgrades. As a result, PDB should only be defined for those who require high-availability and fault-tolerance.

  2. It can be tested inline

  helm template host . --set controllerManager.podDisruptionBudget.maxUnavailable="20%" --set webhook.podDisruptionBudget.maxUnavailable="20%" --set apiServer.podDisruptionBudget.maxUnavailable="20%" --set kubeControllerManager.podDisruptionBudget.maxUnavailable="20%"

or by supplying your own values.yaml

@chaosi-zju
Copy link
Member

ok, got it~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants