← Back to Pull requests

inventory: exclude only the uplinks of the node IP families #409

Open
unknown opened this pull request with 256 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 31, 2026 08:57 UTC
Author

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 ::/0 on 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 (GetNodeHostIPs in k8s.io/kubernetes/pkg/util/node, see kubernetes/kubernetes#95239 and kubernetes/kubernetes#91725): the node IPs are the first InternalIP or ExternalIP plus the first address of the other family, so the families are those of all the InternalIP and ExternalIP addresses. The helper lives in k/k so it is reimplemented here in a new internal/node package (node.IPFamilies, node.DetectIPFamilies). The inventory package only receives the set of families through inventory.WithIPFamilies and 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 ::/0 is not used by Kubernetes and stays allocatable; the admin can filter it with --filter if 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 get on 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.
``

Diff: 256 lines (+192 / -64) across 3 files Reviewer: aojea Review duration: 32335m
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
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.1% (MEDIUM) · Higher = larger blast radius
39.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 20.8% · Safe to merge
20.8%