-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Add DaemonSet support in PDB #98307
Add DaemonSet support in PDB #98307
Conversation
Welcome @shvgn! |
Hi @shvgn. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/remove-sig api-machinery |
Is there a KEP connecting to this? |
@@ -174,14 +182,15 @@ func NewDisruptionController( | |||
// resources directly and only fall back to the scale subresource when needed. | |||
func (dc *DisruptionController) finders() []podControllerFinder { | |||
return []podControllerFinder{dc.getPodReplicationController, dc.getPodDeployment, dc.getPodReplicaSet, | |||
dc.getPodStatefulSet, dc.getScaleController} | |||
dc.getPodStatefulSet, dc.getPodDaemonSet, dc.getScaleController} |
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.
I admit I'm surprised we have added this method in general. Where is the fallback logic to use scale for this case? getExpectedScale() doesn't implement a generic fallback, so that means this logic is not extensible and that's not great. If there is a generic fallback, that would imply this is an optimization only (in which case, I would have expected the bug report to be "controller lookups for daemonsets are slow and this improves performance", which doesn't match what you are reporting).
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.
Is the generic lookup dc.getScaleController? Is Scale not implemented for DaemonSets?
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.
Is Scale not implemented for DaemonSets?
It is not.
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api/apps/v1/types.go#L636
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.
Oh.
Oh....
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.
Hrm. That's really ugly. It should support read scale but not write scale, or reject write scale.
/ok-to-test This should probably have a KEP. kubernetes/enhancements#963 is the KEP for adding support for the scale subresource in PDBs |
@mortent @smarterclayton Thank you for your feedback. There is no KEP for this by now, I'll add one. And I'll look into implementing the scale subresource for DS.
PDB's The |
I have a drain patch that went rotten for draining daemonsets here: #88345 I can revive if necessary if we decide to support this DaemonSet option in PDBs. Right now, 'drain' is really the only (I might be making this up) client that supports the eviction API, so we'd want to get in my change or a similar one. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
@mhmxs regarding your testing in #98307 (comment), I think you might be running into an #116552 issue, which I am trying to fix in #116554 |
@shvgn are you planning to continue with this PR? |
@atiratree hello there! I will continue communication here since @shvgn is unavailable (busy with other important tasks). We in Flant used this patch to prevent unexpected evictions and we are still willing to contribute. I will try to check the code and answer all your questions. |
Thanks, i would retest after the rebase. |
/remove-sig auth |
@nabokihms @shvgn do you have the capacity to look into this for 1.28? |
@atiratree Unfortunately, I won't be able to work on this PR in upcoming weeks. |
/remove-area kubeadm |
/remove-sig instrumentation |
I don't understand what a scale subresource means for a DaemonSet. What I think it'd mean is that setting scale to @shvgn, you'd really need a KEP to make this proposal land. |
@sftim, there was a KEP, but after that, we agreed that this is more a bug than a feature, so KEP is not required. I personally agree with you that a KEP will make things way more transparent for all parties. Can we rediscuss it once again? |
I don't see how absence of a scale subresource for daemonset is a bug... this definitely seems like a feature, and one which (in my opinion) needs more evidence / understanding / design before being accepted or implemented |
@liggitt the initial attempt to write a KEP was here kubernetes/enhancements#3089, but per comment was closed. Should a new KEP for a scale subresource be introduced? Should we discuss offered solution once more (and probably reconsider it)? |
If we want to narrowly make PDB work specifically with daemonset pods and consider it not interoperating with daemonset pods a bug, that's one thing. If we want to fix that issue by adding a scale subresource to DaemonSet, I think that needs a KEP, since it has implications way beyond PDB. |
As @sftim mentioned, the whole idea seems odd, like how can we scale pods for the controller that suppose to run pods on every node? However, ignoring PDB is another odd thing because PDB is not about scaling (despite being connected to a scale subresource in other controllers' implementation). My intention is only to fix PDB, not invent a whole new conception of daemonset scaling. |
so maybe that means teaching the disruption controller about daemonsets specifically in kubernetes/pkg/controller/disruption/disruption.go Lines 244 to 258 in c184284
|
I just want to emphasise, that this is about adding a read only scale subresource, so we would not have to solve scaling of the DS in any sense. But since adding only part of the scale API could have implications for other users, adding the DS finder seems like a simpler/easier thing to do in the short term. |
@nabokihms our usecase is a bit different. We need this feature to prevent deleting nodes. If PDB Currently, this is not available, and we need an extra controller to update |
Hey, @shvgn do you plan to get back to this PR? If not I can take over and go with the |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind fix
/sig apps
What this PR does / why we need it:
Supports DaemonSets in disruption controller by adding /scale subresource to daemonsets API. It allows to control the eviction rate of DaemonSet pods.
Which issue(s) this PR fixes:
#108124
Does this PR introduce a user-facing change?: