OCPBUGS-95615: fix(kubevirt): use only first MachineInternalIP per family in EndpointSlice endpoints#8892
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis change updates KubeVirt passthrough endpoint-slice address collection so each machine contributes only the first IPv4 InternalIP and the first IPv6 InternalIP. The test suite adds machines with multiple same-family InternalIPs and verifies both default ingress passthrough and KCCM endpoint slices keep only the first address from each family. Changes
Estimated code review effort: Medium Suggested labels: bug, tests Suggested reviewers: Not enough information available from the summary. 🐰 PoemOne IPv4, one IPv6, 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/jira refresh |
|
@dpateriya: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@dpateriya: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@dpateriya: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@dpateriya: This pull request references Jira Issue OCPBUGS-95615, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8892 +/- ##
==========================================
+ Coverage 43.28% 43.45% +0.17%
==========================================
Files 771 771
Lines 95503 95721 +218
==========================================
+ Hits 41335 41600 +265
+ Misses 51284 51234 -50
- Partials 2884 2887 +3
... and 14 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/Verified by me Env: OCP 4.21.21 Management Cluster Machine addresses (before fix) Machine kubevirt-test-vh8dr-4t9bh reports two non-link-local IPv4 InternalIPs: BEFORE (unpatched HCCO) EndpointSlice contains both addresses — traffic round-robins to the non-routable IP: AFTER (patched HCCO) Patched the HCCO deployment with the fix image, deleted EndpointSlices, and they were recreated with only the first address per family: Only 10.130.2.8 (the routable VM pod IP) is present. The 10.132.0.2 (ovn-k8s-mp0) is correctly filtered. |
|
@dpateriya: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@csrwng: This pull request references Jira Issue OCPBUGS-95615, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
jparrill
left a comment
There was a problem hiding this comment.
Dropped some comments. Thanks!
…tSlice endpoints Since CAPK PR openshift#366 exposes all VMI interface IPs for dual-stack CSR approval, Machine.Status.Addresses includes ovn-k8s-mp0 management port IPs from the guest cluster's OVN overlay alongside the VM's routable pod network IP. The HCCO machine controller was putting all MachineInternalIP addresses into EndpointSlice Endpoint.Addresses, causing MetalLB/kube-proxy to round-robin traffic to non-routable IPs and producing ~50% connection timeouts on LoadBalancer services. The existing link-local filter (OCPBUGS-83711) does not catch these IPs because they are regular RFC1918 addresses (e.g. 10.8.x.2), not link-local. Use only the first MachineInternalIP per IP family, which is the VM's primary pod network IP on the management cluster. This matches the convention already used in e2e tests (firstMachineAddress). Signed-off-by: Divyam Pateriya <dpateriy@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
9b87317 to
0082479
Compare
|
Suggested changes have been made. Thanks @jparrill for the review |
|
/verified by me |
|
@dpateriya: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@dpateriya: This pull request references Jira Issue OCPBUGS-95615, which is valid. 3 validation(s) were run on this bug
DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
jparrill
left a comment
There was a problem hiding this comment.
Re-reviewed: both comments addressed. LGTM.
/lgtm
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dpateriya, jparrill The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-v2-gke |
|
/test e2e-aws |
|
I now have all the evidence needed. Let me produce the final report. Test Failure Analysis:
|
| Time (UTC) | Event |
|---|---|
| 18:19:50 | Azure resource creation begins |
| 18:21:26 | HostedCluster + 3 NodePools applied |
| 18:22:03 | CPO begins reconciling CNO component |
| 18:29:27 | Konnectivity-server container starts (in kube-apiserver pod) |
| 18:30:06 | HostedCluster enters Partial state |
| 18:30:16 | CVO first reports: Cluster operator network is not available |
| 18:30:32 | Konnectivity: "Receive channel from agent is full" warnings begin |
| 18:34:42–18:35:44 | Konnectivity agents connect (18 agents), but CNO still empty |
| 18:48:41 | CAPI provider: Client.Timeout exceeded while awaiting headers — loses leader lease |
| 18:53:35+ | All 18 worker nodes report NetworkPluginNotReady |
| ~18:51:26 | create-management-cluster step times out |
CNO Pod Container Logs (ALL EMPTY):
cluster-network-operator(current + previous): 0 linesinit-client-token-minter(current + previous): 0 linesremove-old-cno(current + previous): 0 linesclient-token-minter(current + previous): 0 lineskonnectivity-proxy-socks5(current + previous): 0 linesavailability-prober(current + previous): 0 lines
Worker Node Condition (all 18 nodes, 3 pools × 6 nodes):
KubeletNotReady: container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: No CNI configuration file in /etc/kubernetes/cni/net.d/. Has your network provider started?
HostedCluster Status:
Available: False (ComponentsNotAvailable)
Missing: cluster-image-registry-operator, cluster-policy-controller,
cluster-network-operator, csi-snapshot-controller-operator,
ingress-operator, certified-operators-catalog
Degraded: True (UnavailableReplicas)
cluster-network-operator deployment has 1 unavailable replicas
ClusterVersionSucceeding: False (ClusterOperatorsNotAvailable)
13 operators not available: console, csi-snapshot-controller, dns,
image-registry, ingress, insights, kube-storage-version-migrator,
monitoring, network, node-tuning, openshift-samples, service-ca, storageCascading post-phase failures (consequences, not causes):
destroy-guests: Failed to destroy clusters (HostedCluster was in bad state)hypershift-k8sgpt:the server doesn't have a resource type "hostedcluster"(expected when cluster never fully started)
Artifacts: .work/prow-job-analyze-test-failure/2075279554284359680/logs/
|
@dpateriya: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@dpateriya: Jira Issue Verification Checks: Jira Issue OCPBUGS-95615 Jira Issue OCPBUGS-95615 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/cherrypick release-4.22 |
|
@dpateriya: new pull request created: #8978 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@dpateriya: new pull request created: #8979 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Fix included in release 5.0.0-0.nightly-2026-07-10-112516 |
What this PR does / why we need it:
Since CAPK PR kubernetes-sigs/cluster-api-provider-kubevirt#366 began exposing all VMI interface IPs for dual-stack CSR approval,
Machine.Status.Addressesincludesovn-k8s-mp0management port IPs from the guest cluster's OVN overlay alongside the VM's routable pod network IP.The HCCO machine controller was putting all
MachineInternalIPaddresses intoEndpointSlice.Endpoint.Addresses, causing MetalLB/kube-proxy to round-robin traffic to non-routableovn-k8s-mp0IPs and producing ~50% connection timeouts on LoadBalancer services exposed via MetalLB.The existing link-local filter (OCPBUGS-83711, PR #8264) does not catch these IPs because they are regular RFC1918 addresses (e.g.
10.8.x.2), not link-local.This PR uses only the first
MachineInternalIPper IP family, which is the VM's primary pod network IP on the management cluster. This matches the convention already used in e2e tests (firstMachineAddressinnodepool_kv_advanced_multinet_test.go).Which issue(s) this PR fixes:
Related to OCPBUGS-83711 (link-local filter) and OCPBUGS-84269 / PR #8230 (CIDR conflict false positive) — same root cause (CAPK PR #366), different symptom.
Customer cases: 04485238, 04485252
Checklist:
Made with Cursor
Summary by CodeRabbit