feat(mgmt-agent): detect nodes that never reached Ready (AROSLSRE-1983) #6782
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #6782"
general
weight: 0.35
stevekuznetsov
Jira: AROSLSRE-1983
What
Adds a
never-readydetector for a node that registers and never reaches Ready.Its evidence is the Node object alone: the Ready condition has never been True, and its first transition coincides with the node's creation. A node that reached Ready at any point has a strictly later transition, which is what separates "never started" from "started and later failed".
Three supporting changes:
nodeDetectorsub-interface, so a node-state detector fits without wideningEvaluatefor every existing detector.Decidenow runs node-state detectors on the NotReady path and the pod/event detectors on the Ready path. The Ready path is unchanged.Snapshot.Detail, an escape hatch for the reason annotation.Why
Decideskips any NotReady node:Correct for a node that was Ready and dropped out. Wrong for one that never got there, because nothing in node lifecycle rescues it.
INT node
aks-userswft3-65765115-vmss00000g(int-westus3, AROSLSRE-1976) failed provisioning with a terminalOSProvisioningClientError, registered, never came up, and sat NotReady for 22 hours until a human cordoned it. From its capturednode.yaml:The condition was written once at registration and never moved, so the two timestamps are identical.
The dwell is 30 minutes, set from data. Across 1,119 dev nodes over 14 days, time from creation to first
Ready=Truewas p50 1.0m, p90 1.3m, p99 3.1m, max 3.4m. Every node that was going to come up did so inside 3.4 minutes, so 30 minutes is about nine times the worst legitimate bootstrap, and still 44 times faster than the 22 hours we actually took.Why
Snapshot.Detailis needed:labeler.gofills the reason annotation fromReasonString(), which renders pod counts. A born-broken node would otherwise be annotated "0 pods stuck past dwell (0 stuck total), no recent success in 0s window". Detectors that leaveDetailempty render byte-identically to before, which is pinned by a test.Why generic rather than IMDS-specific: dead IMDS, a failed disk, a kubelet certificate problem and a failed image pull are all born broken and all remedied by reimaging, and one detector is one fault with one remedy. The cause goes in the signature annotation instead, taken from the Ready condition's reason. A cause-specific detector would also have to read azure-cns container logs, which this controller never does.
Testing
go build,go vet,gofmtandgo test ./pkg/controller/nodehealth/...all clean. Every pre-existing test passes untouched.New tests cover the dwell boundary (including exactly at the dwell), the born-broken discriminator, a node that was Ready and dropped out, the registration tolerance either side, unusable evidence (no Ready condition, missing timestamps, clock skew), an empty Ready reason, ownership of a non-SWIFT node, and that the Ready path still belongs to
swift-vf-teardown.TestProductionBornBrokenNodeFiresreplays the captured INT node with its verbatim timestamps and asserts it fires at the dwell and not a second earlier.I also mutation-checked the tests: removing the born-broken discriminator fails 4 of them and zeroing the dwell fails 2, so they are not passing vacuously.
Special notes for your reviewer
This cannot cause disruptive remediation. The controller stops at labelling; mitigation of a labelled node is owned by a separate controller that is not shipped.
Ownership is deliberately narrower than the fault. The detector reuses
isSwiftV2Nodeeven though a born-broken node is not a SWIFT problem.AnyAppliesruns ahead of the Ready gate and decides which nodes we hold labels on at all, so a detector applying to every node would makeDecisionNotApplicableunreachable, and that is the only thing that retires a stale label. I verified the captured INT node did carrykubernetes.azure.com/podnetwork-swiftv2-enabled=true, so the scope is correct rather than lucky. Widening it is a separate decision.A silent node still gets evaluated: a born-broken node produces no pods or events, but
resyncAllre-enqueues every candidate node every 30 seconds, so it fires at the dwell rather than waiting for unrelated traffic.Two open questions I would rather surface than bury:
1. Should AKS node auto-repair have owned this? It targets nodes that were healthy and went NotReady, so a never-provisioned instance plausibly falls outside it, which is the gap this fills. If it should have caught it, the better fix is an AKS bug and this becomes a stopgap.
2. The dwell rests on dev data, because prod does not snapshot Node objects today. Worth re-checking once it does.
This is independent of #6769 and #6776, which change detector thresholds rather than the Ready gate. I trial-merged all three: they auto-merge with no conflicts and the full suite passes on the combined tree.
PR Checklist
go build,go vet,gofmtclean