report why a Node is left out of the target groups - #199
Open
m1ron0xFF wants to merge 1 commit into
Open
Conversation
Draft
4 tasks
m1ron0xFF
force-pushed
the
feat/report-uninitialized-nodes
branch
from
August 20, 2026 08:15
4c672ad to
56bf457
Compare
An empty spec.providerID hides two causes that need different fixes, and
skipping the Node without saying which one it is turns a real capacity loss
into a silent one. The node.cloudprovider.kubernetes.io/uninitialized taint
tells them apart at no cost:
- taint present: kubelet did hand the Node to a cloud provider and
cloud-node has not initialized it yet, normally a matter of seconds;
- taint absent: the Node was never offered to a cloud provider, so it is
either a genuine static Node or a cloud VM whose kubelet is missing
--cloud-provider=external, and it stays out of the target groups until
that is fixed.
Raised while reviewing #195, which hit the second case in production and
proposed backfilling providerID instead. Backfilling writes an immutable
field from a Node-name lookup, so a wrong match becomes permanent, and the
root cause is cluster configuration that also affects Node addresses, zones
and instance types. Reporting which cause it is, is the part that belongs
in the target group syncer.
The bookkeeping behind that report is a rendered string rather than a set,
so the accumulation loop, the nil guard and a duplicate join disappear and
the zero value means "nothing skipped before" on its own. Reasons are
sorted, which is what makes the comparison correct at all - Node order from
the informer is not stable - and keeps the logged line stable between
reports. cleanUpTargetGroups resets it alongside lastVisitedNodes: both
describe target groups that have just been removed.
Signed-off-by: Egor Balakin <14162703+m1ron0xFF@users.noreply.github.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
m1ron0xFF
force-pushed
the
feat/report-uninitialized-nodes
branch
from
August 20, 2026 08:33
56bf457 to
d775554
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Improves the report about Nodes that target group synchronization leaves out.
Says which of two causes an empty
spec.providerIDis. The two need completelydifferent remediation, and skipping the Node without naming the cause turns a real
capacity loss into a silent one. The
node.cloudprovider.kubernetes.io/uninitializedtaint tells them apart at no cost — it sits on the Node object, so no cloud API call
is involved:
cloud-nodehas not initialized it yet, normally a matter of secondsawaiting cloud-node initialization--cloud-provider=externalno <taint> taint, never handed to a cloud providerSimplifies the bookkeeping behind that report.
lastSkippedNodesgoes from amapset.Setto the rendered string, so the accumulation loop, the nil guard and aduplicate
strings.Joindisappear, and the zero value means "nothing skipped before"on its own. Reasons are sorted, which is what makes the comparison correct — Node
order from the informer is not stable — and also keeps the logged line stable between
reports.
hasTaintis shared withnodeEligibleForLoadBalancer, which carried the same loop.Why not backfill the ProviderID instead
#195 hit the second case in production and proposed resolving the Instance by Node
name and patching
spec.providerID. That was not taken:spec.providerIDis immutable once set, and the value would come from a Node-namelookup, so a wrong match becomes permanent — unfixable without deleting the Node
object.
cloud-nodealready owns this: it setsspec.ProviderIDwhen empty, using the samename-based fallback. Doing it again from the load balancer path races that controller.
instance types — far more than load balancers.
Reporting which cause it is, is the part that belongs in the target group syncer.
Base
Based on
fix/skip-empty-provider-id-nodes(#198), not onmaster: this changespartitionNodesByProviderID, which #198 introduces. GitHub will retarget this PR tomasteronce #198 merges.Testing
go build ./...,go vet ./pkg/...,go test ./pkg/....TestPartitionNodesByProviderIDDistinguishesUninitializedFromStaticNodesasserts thetwo causes produce different messages.
TestNewlySkippedNodesReportsOnlyOnChangecovers the dedup, including that reasons are sorted and that a reshuffled slice is
treated as unchanged. Both were verified by mutation — inverting the taint check and
dropping the sort each make the corresponding test fail.