-
Notifications
You must be signed in to change notification settings - Fork 237
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
Custom Deprovisioning Trigger Mechanism #688
Comments
While you could just do In the near future, we'll release some additional work needed for the full machine migration, which moves these disruption decisions to the Machine Status conditions here: #319. In all, I think it's reasonable to allow a custom controller to annotate nodes as needing deprovisioning, rather than letting users mess with the Expiration/Drift annotations. May I ask what kind of custom signals you use to choose nodes as being deprovisioned? Is there a gap in the deprovisioning logic that we need to implement, or is it simply just a matter of filling in the gaps where Drift isn't implemented yet? If you're also willing to design and implement this (both should be relatively simple), I'm happy to walk through this with you and get you ramped up on it. |
I mean, right now there are a ton of gaps. It was quite useful that I could just annotate all at once and Karpenter would do a serial replacement to minimize disruption in the cluster. It generally hasn't been clear to me how disruptive it'd be to just delete a pile of nodes wholesale. Long term, I was sorta expecting there are always going to be gaps (is karpenter going to be able to drift on userdata changes for example?). My current migration is dockerd -> containerd which is not drifted. I don't think I have slack probably this quarter to get into this. |
I updated the title to be more general based off our discussion. This could look like users adding an annotation/label/taint for Karpenter to discover and then implement it as another deprovisioner in the Deprovisioning loop. |
One workflow that has come up that might be applicable for this is how to eventually force all pods that are using We'd found that the nodes end up getting left around since Karpenter is also not cordoning the nodes that these pods are on to allow them to eventually drain out of the cluster. Another thought though would be to modify how this annotation is treated if maintenance window type support was added to Karpenter (ref: #753). I think at least operationally allowing a maintenance window to force node replacements may be desirable by a lot of organizations. |
Exactly this. If this is actually a safe operation, I'd be happy to do that, but it just isn't obvious right now whether If This is essentially the equivalent of an ASG's instance refresh feature that's notably missing since I switched to karpenter. |
I think that the obvious use case here is a cluster upgrade where you want to upgrade your nodes. and also, im actually asking, what would be the best way of doing so in that situation right now (0.30.0) |
I haven't really found any better way to deal with it than draining or deleting the node. I actually am not sure if with Karpenter now on delete would launch a new node before draining it. |
Wanted to add more to this. Currently we have an internal system that marks node for killing for reasons that K8s has no idea about for SOX and/or compliances or CVE related reasons. We are building a controller to read these and annotated our nodes for killing. We realize having 2 systems that kill nodes means it is difficult if not impossible to understand termination budget of the fleet so if we can get Karpenter to reap instead then we can maintain a realistic termination budget. |
@garvinp-stripe or @sidewinder12s, let me know if you want to help implement this. I can help guide through this, and it should be fairly straightforward. |
/assign |
Posting thoughts here for you on how to approach this: Design
Implementation There's a
|
@tasdikrahman Any update on this? We are looking for a similar feature to bulk recycle nodes on-demand. Thanks! |
Sorry @njtran I was out of town for a bit. Let me check with my team to see if I can spend some time around this |
Hey folks sorry for the delay, I am starting work on this, this week. Will keep you posted here. |
@tasdikrahman Feel free to reach out if you need any assistance here. I know that @njtran is on PTO for a bit so he may be slower to respond. |
@njtran With forceful expiration coming back. Do you think we can simply mark nodes as "expired" for this scenario? |
Seems like this would basically have the same effect as just doing a kubectl delete at this point. The other thing is that I imagine that this request to disrupt is for a subset of nodes owned by a NodePool, not for the whole thing. I'm not sure that there's a good workaround for this problem right now other than doing something hacky like messing with Karpenter's drift annotation to make it different than the one that is attached to the NodePool or NodeClass. Still seems reasonable to me to support something like an annotation on the NodeClaim/Node that would trigger a status condition and the disruption controller to mark the node as eligible for removal. |
Description
Allow users to trigger node Drift
What problem are you trying to solve?
In Karpenter pre-v0.28, I had started using the karpenter drift annotation
karpenter.sh/voluntary-disruption=drifted
as a way to force nodes to get replaced in an orderly fashion when I changed configuration that was not supported by Karpenters Drift detection.In v0.28 this was removed and now the annotation is simply removed by Karpenter.
I found the ability to trigger drift useful in testing and in filling in the gaps in Drift support. I'd also assume long term, there may be corner cases users would want to trigger replacement on that drift cannot detect or detect easily.
Perhaps just another annotation indicating user requested drift so that Karpenter can replace nodes in an orderly manner and while respecting deprovisioning controls.
How important is this feature to you?
The text was updated successfully, but these errors were encountered: