Set RequeueAfter so liveness subreconciler fires when no more node events #779
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.
1. Issue, if available:
N/A
2. Description of changes:
This sets a RequeueAfter on the liveness reconciler result, if it's been less than
LivenessTimeout
since the node was created. This ensures that even if there's no more subsequent node events we still consider the worker node for termination later.If you don't do so, you may enter into a runaway scaling problem where Karpenter will keep launching new nodes and pods indefinitely. The pods get stuck in
Terminating
state and the liveness reconciler never terminates the oldNotReady
worker nodes because no new node events are being generated and therefore the reconciler is never triggered.How to reproduce the issue?
Configure Karpenter to launch worker nodes in a subnet that has no network connectivity. For example my subnet had a bad route table (no gateways).
I verified after this code change, that after 15 minutes the nodes in NotReady status were terminated.
3. Does this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.