fix(controller): handle node deletion, label selector unmatching, and status drift in NodeReconciler - #339
Conversation
✅ Deploy Preview for node-readiness-controller canceled.
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: bhuvan-somisetty The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @bhuvan-somisetty. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
1128043 to
6c6a68e
Compare
|
@bhuvan-somisetty: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn 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-sigs/prow repository. |
6c6a68e to
9e9a1d1
Compare
|
/retest |
|
@bhuvan-somisetty: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn 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-sigs/prow repository. |
9e9a1d1 to
acfc6f7
Compare
|
Hi @ajaysundark @vitorfloriano @Priyankasaggu11929, Could you please take a look at this PR when you get a chance? This PR resolves issue #338 by fixing node deletion cleanup, label selector unmatching taint removal, and real-time \AppliedNodes\ status synchronization across \NodeReconciler\ and \RuleReconciler. Thanks! |
|
Thanks for the PR @bhuvan-somisetty! I'll spend some time understanding the reported issue (because I've a feeling that atleast will drop some comments by EOD tomorrow. |
|
/ok-to-test |
|
we are looking to move away from per-node status updates in NRC #89, this could wait until the per-node api is landed? also it is a good idea to send small PRs with reviewable context than to push multiple orthogonal changes into a single PR. xref -- #338 (comment) |
|
Good call, dropped the AppliedNodes real-time sync piece since it's per-node status work that #89 is going to replace anyway. Also pulled the selector-unmatch taint cleanup out into its own issue (#342) per your comment on #338, so this PR is now scoped to just node deletion handling + making cleanupDeletedNodes cover AppliedNodes/FailedNodes too, not just NodeEvaluations. Pushed the update. |
0f0a49a to
6337954
Compare
Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
Drop the selector-unmatch taint cleanup (split into kubernetes-sigs#342 for its own design discussion) and the AppliedNodes real-time sync (deferred since kubernetes-sigs#89 plans to move per-node status out of rule.status entirely). This keeps the change scoped to handling node deletion and making cleanupDeletedNodes cover AppliedNodes/FailedNodes, not just NodeEvaluations.
6337954 to
c3bb1da
Compare
|
Rebased onto main to resolve the conflict in node_controller.go and pushed. All checks (test, test-e2e, verify-all) are passing now, ready for review. |
|
PR needs rebase. DetailsInstructions 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-sigs/prow repository. |
|
@bhuvan-somisetty: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Description
This PR resolves issue #338 by fixing systemic node lifecycle state management, orphaned taint cleanup, and status synchronization bugs across
NodeReconcilerandRuleReconciler:NodeReconciler.Reconcilehandles theapierrors.IsNotFound(err)condition viahandleNodeDeletion(ctx, nodeName). It purges the deleted node fromrule.Status.NodeEvaluations,rule.Status.AppliedNodes, andrule.Status.FailedNodesacross all cached rules and updates Prometheusnode_readiness_nodes_by_stategauge metrics.cleanupDeletedNodes: UpdatedRuleReconciler.cleanupDeletedNodesto filterAppliedNodesandFailedNodesalongsideNodeEvaluations.processNodeAgainstAllRules, when a node's labels change such that it no longer matches a rule'sspec.NodeSelector, the controller checks if the node holdsrule.Spec.Taintor has status entries. If so, it invokesremoveTaintBySpecto remove the orphaned taint and strips the node from rule status.AppliedNodesSynchronization: UpdatedNodeReconcilerstatus patch logic to append matching nodes torule.Status.AppliedNodesupon successful evaluation or remove them if evaluation fails/unmatches.Related Issue
Fixes #338
Type of Change
/kind bug
Testing
internal/controller/node_controller_test.goandinternal/controller/nodereadinessrule_controller_test.gocovering node deletion handling, label selector unmatch taint removal, andAppliedNodesstatus synchronization.Checklist
make testpassesmake lintpassesDoes this PR introduce a user-facing change?
Signed-off-by: bhuvan-somisetty somisettybhuvan5@gmail.com