Skip to content

fix(api): [release-4.22] OCPBUGS-86679: add IPv6 OVN join subnet config to prevent dual-stack routing collision#8625

Open
orenc1 wants to merge 1 commit into
openshift:release-4.22from
orenc1:backport-8421-release-4.22
Open

fix(api): [release-4.22] OCPBUGS-86679: add IPv6 OVN join subnet config to prevent dual-stack routing collision#8625
orenc1 wants to merge 1 commit into
openshift:release-4.22from
orenc1:backport-8421-release-4.22

Conversation

@orenc1
Copy link
Copy Markdown
Contributor

@orenc1 orenc1 commented May 28, 2026

This is a manual cherry-pick of PR #8421

When a KubeVirt hosted cluster and its management cluster both use OVN-Kubernetes with dual-stack networking, they each default to fd98::/64 for the IPv6 join switch subnet. External IPv6 LoadBalancer traffic targeting VM pods is SNAT'd to the management cluster's join IP (e.g. fd98::2). Inside the VM, the guest cluster's OVN intercepts the response because it also owns fd98::/64, black-holing the packet.
This commit fixes the issue by:

  1. Automatic KubeVirt default: for KubeVirt hosted clusters with OVNKubernetes, the reconciler now sets IPv6.InternalJoinSubnet to fd99::/64 by default
  2. User-facing API: adds OVNIPv6Config type to OVNKubernetesConfig, allowing explicit configuration of IPv6 internalJoinSubnet and internalTransitSwitchSubnet

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-86679

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

…ual-stack routing collision

When a KubeVirt hosted cluster and its management cluster both use
OVN-Kubernetes with dual-stack networking, they each default to
fd98::/64 for the IPv6 join switch subnet. External IPv6 LoadBalancer
traffic targeting VM pods is SNAT'd to the management cluster's join IP
(e.g. fd98::2). Inside the VM, the guest cluster's OVN intercepts the
response because it also owns fd98::/64, black-holing the packet.

This commit fixes the issue in two ways:

1. Automatic KubeVirt default: for KubeVirt hosted clusters with
   OVNKubernetes, the reconciler now sets IPv6.InternalJoinSubnet to
   fd99::/64 by default, avoiding the collision with the management
   cluster's fd98::/64. This mirrors the existing V4InternalSubnet
   override (100.66.0.0/16) already in place for IPv4.

2. User-facing API: adds OVNIPv6Config type to OVNKubernetesConfig,
   allowing explicit configuration of IPv6 internalJoinSubnet and
   internalTransitSwitchSubnet for any platform. This maps to the
   upstream operatorv1.IPv6OVNKubernetesConfig and includes IPv6 CIDR
   format validation via CEL rules.

Also extends CIDR overlap validation in the HostedCluster webhook to
cover IPv6 OVN subnets, and adds envtest CRD validation cases.

Fixes: https://redhat.atlassian.net/browse/OCPBUGS-84303

Signed-off-by: Oren Cohen <ocohen@redhat.com>
Assisted-by: Claude <noreply@anthropic.com>
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@orenc1: This pull request references Jira Issue OCPBUGS-86679, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected Jira Issue OCPBUGS-86679 to depend on a bug targeting a version in 5.0.0 and in one of the following states: MODIFIED, ON_QA, VERIFIED, but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This is a manual cherry-pick of PR #8421

Assisted-by: Claude noreply@anthropic.com

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-86679

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 421941c8-d064-4873-b526-7a7763ab4e9b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot added do-not-merge/needs-area area/api Indicates the PR includes changes for the API labels May 28, 2026
@openshift-ci openshift-ci Bot requested review from muraee and sjenning May 28, 2026 14:37
@openshift-ci openshift-ci Bot added area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation and removed do-not-merge/needs-area labels May 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@orenc1: This pull request references Jira Issue OCPBUGS-86679, which is invalid:

  • expected Jira Issue OCPBUGS-86679 to depend on a bug targeting a version in 5.0.0 and in one of the following states: MODIFIED, ON_QA, VERIFIED, but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

This is a manual cherry-pick of PR #8421

When a KubeVirt hosted cluster and its management cluster both use OVN-Kubernetes with dual-stack networking, they each default to fd98::/64 for the IPv6 join switch subnet. External IPv6 LoadBalancer traffic targeting VM pods is SNAT'd to the management cluster's join IP (e.g. fd98::2). Inside the VM, the guest cluster's OVN intercepts the response because it also owns fd98::/64, black-holing the packet.
This commit fixes the issue by:

  1. Automatic KubeVirt default: for KubeVirt hosted clusters with OVNKubernetes, the reconciler now sets IPv6.InternalJoinSubnet to fd99::/64 by default
  2. User-facing API: adds OVNIPv6Config type to OVNKubernetesConfig, allowing explicit configuration of IPv6 internalJoinSubnet and internalTransitSwitchSubnet

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-86679

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@openshift-ci openshift-ci Bot added the area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release label May 28, 2026
@orenc1
Copy link
Copy Markdown
Contributor Author

orenc1 commented May 28, 2026

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown

@orenc1: This pull request references Jira Issue OCPBUGS-86679, which is invalid:

  • expected Jira Issue OCPBUGS-86679 to depend on a bug targeting a version in 5.0.0 and in one of the following states: MODIFIED, ON_QA, VERIFIED, but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@orenc1
Copy link
Copy Markdown
Contributor Author

orenc1 commented May 28, 2026

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels May 28, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@orenc1: This pull request references Jira Issue OCPBUGS-86679, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-84303 is in the state MODIFIED, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-84303 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents
Details

In response to this:

/jira refresh

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
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 77.61194% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.24%. Comparing base (8db1b8a) to head (7fbd027).
⚠️ Report is 6 commits behind head on release-4.22.

Files with missing lines Patch % Lines
...rconfigoperator/controllers/resources/resources.go 20.00% 9 Missing and 3 partials ⚠️
...perator/controllers/resources/network/reconcile.go 83.33% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release-4.22    #8625      +/-   ##
================================================
+ Coverage         35.21%   35.24%   +0.02%     
================================================
  Files               767      767              
  Lines             93511    93576      +65     
================================================
+ Hits              32933    32983      +50     
- Misses            57893    57904      +11     
- Partials           2685     2689       +4     
Files with missing lines Coverage Δ
...trollers/hostedcluster/hostedcluster_controller.go 43.75% <100.00%> (+0.48%) ⬆️
...perator/controllers/resources/network/reconcile.go 59.32% <83.33%> (+3.87%) ⬆️
...rconfigoperator/controllers/resources/resources.go 50.33% <20.00%> (-0.18%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jparrill
Copy link
Copy Markdown
Contributor

/approve

@orenc1 orenc1 changed the title fix(api): OCPBUGS-86679: add IPv6 OVN join subnet config to prevent dual-stack routing collision fix(api): [release-4.22] OCPBUGS-86679: add IPv6 OVN join subnet config to prevent dual-stack routing collision May 28, 2026
Copy link
Copy Markdown
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from the API side.

/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 4, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks-4-21
/test e2e-aws-4-21
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 4, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: everettraven, jparrill, orenc1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2026
@orenc1
Copy link
Copy Markdown
Contributor Author

orenc1 commented Jun 5, 2026

/retest-required

1 similar comment
@orenc1
Copy link
Copy Markdown
Contributor Author

orenc1 commented Jun 7, 2026

/retest-required

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Jun 7, 2026

@orenc1: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aks-4-21 7fbd027 link true /test e2e-aks-4-21
ci/prow/e2e-aws-4-21 7fbd027 link true /test e2e-aws-4-21
ci/prow/e2e-aws-upgrade-hypershift-operator 7fbd027 link true /test e2e-aws-upgrade-hypershift-operator
ci/prow/e2e-aws 7fbd027 link true /test e2e-aws
ci/prow/e2e-aks 7fbd027 link true /test e2e-aks

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api Indicates the PR includes changes for the API area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants