kubernetes-sigs / kubernetes-sigs/node-readiness-controller
[BUG] Handle node deletion, label selector unmatching, and status drift in NodeReconciler
@bhuvan-somisetty is already working on this.
Since Aug 2, 2026.
- Dominant language
- Go
- Stars
- 164
- Forks
- 75
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 13
Description
What happened?
When a node is deleted from the cluster, NodeReconciler.Reconcile gets a NotFound error from r.Get and silently swallows it via client.IgnoreNotFound(err). The deleted node is never removed from rule.Status.NodeEvaluations, AppliedNodes, or FailedNodes on any rule, and the node_readiness_nodes_by_state metric keeps counting it forever.
Separately, RuleReconciler.cleanupDeletedNodes only filters NodeEvaluations — it misses AppliedNodes and FailedNodes, so those two fields also go stale.
Two related points originally filed here are split out per this review:
AppliedNodesreal-time sync — deferred until #89 lands (per-node status is moving out ofrule.statusentirely).- Orphaned taints on selector unmatch — moved to #342 (needs its own design discussion).
Expected behavior
- Deleting a node removes it from
NodeEvaluations,AppliedNodes, andFailedNodeson every rule, and updates the metric. cleanupDeletedNodescleans up all three fields, not justNodeEvaluations.
Repro
- Create a
NodeReadinessRulematching worker nodes. - Confirm a node shows up in
rule.Status.NodeEvaluations/AppliedNodes. kubectl delete node worker-1.worker-1is still in the rule status and in/metrics.
Affected components
internal/controller/node_controller.go(Reconcile)internal/controller/nodereadinessrule_controller.go(cleanupDeletedNodes)
Controller version / K8s version
main (v0.4.1+) / v1.30.0–v1.31.0
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.