inventory: exclude only the uplinks of the node IP families #409
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 256 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.332
Real PR Conversation Timeline
1 comments
"Review active on #409"
general
weight: 0.35
aojea
DRANET excludes from the inventory the interfaces that hold the default route of the host, so pods cannot take the node uplink. It did so for both IPv4 and IPv6 regardless of the cluster configuration.
This PR detects the IP families of the cluster on this node from the node addresses and only excludes the default-gateway uplinks of those families.
On a single-stack cluster a NIC that is not used by Kubernetes can still have a default route of the other family, for example an RA-learned
::/0on an RDMA NIC in an IPv4 cluster. That NIC was wrongly excluded from the inventory.The heuristic is the same kube-proxy uses to pick its IP family (
GetNodeHostIPsink8s.io/kubernetes/pkg/util/node, see kubernetes/kubernetes#95239 and kubernetes/kubernetes#91725): the node IPs are the firstInternalIPorExternalIPplus the first address of the other family, so the families are those of all theInternalIPandExternalIPaddresses. The helper lives in k/k so it is reimplemented here in a newinternal/nodepackage (node.IPFamilies,node.DetectIPFamilies). The inventory package only receives the set of families throughinventory.WithIPFamiliesand does not know how they are derived.| Node IPs | Excluded uplinks |
|---|---|
| dual-stack | both the IPv4 and IPv6 default-route NICs. Pods must not take either node uplink. |
| IPv4 only | only the IPv4 default-route NIC. A NIC whose only default route is
::/0is not used by Kubernetes and stays allocatable; the admin can filter it with--filterif needed. || IPv6 only | only the IPv6 default-route NIC. |
| no addresses after 30s | both families, with a warning (previous behavior). |
The node is polled every 1s for up to 30s for the addresses, same values kube-proxy uses. RBAC already grants
geton nodes.``
release-note
``DRANET uses the cluster IP family to avoid filtering the uplink interfaces of the IP families that are not configured in the cluster, per example, an IPv4 only cluster will not filter IPv6 uplink interfaces.