Skip to content

MGMT-21212: Enable dual-stack clusters with image-based installations#9847

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
danmanor:enable-dual-stack
Aug 13, 2025
Merged

MGMT-21212: Enable dual-stack clusters with image-based installations#9847
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
danmanor:enable-dual-stack

Conversation

@danmanor
Copy link
Contributor

@danmanor danmanor commented Jul 23, 2025

🎯 Overview

This PR adds comprehensive dual-stack networking support to OpenShift image-based installations, enabling clusters to use both IPv4 and IPv6 networks simultaneously. This addresses the growing need for dual-stack deployments in modern containerized environments.

🚀 Key Features

Dual-Stack Network Configuration Support

  • Multiple Machine Networks: Extended support from single MachineNetwork to multiple MachineNetworks array
  • IPv4 + IPv6 Support: Full support for configuring both IPv4 and IPv6 machine networks
  • Validation Logic: Added comprehensive validation to ensure dual-stack configurations are valid (max 2 networks, one IPv4 + one IPv6)

Enhanced Data Structures

  • Updated SeedReconfiguration: Added MachineNetworks []string field while maintaining backward compatibility with deprecated MachineNetwork
  • Install Config Validation: Extended validation to support dual-stack machine network configurations

Comprehensive Testing

  • Install Config Tests: 189+ lines of new test cases covering dual-stack scenarios
  • Test Infrastructure: Improved test setup with proper resource management
  • Edge Cases: Coverage for mixed static/DHCP, user-provided args, and validation scenarios

✅ Validation & Testing

  • ✅ All existing tests pass
  • ✅ New dual-stack test scenarios added
  • ✅ Backward compatibility maintained
  • ✅ Edge cases covered (single-stack, invalid configs, user overrides)

🔄 Backward Compatibility

  • Maintains full backward compatibility with existing single-stack configurations
  • Deprecated MachineNetwork field still supported but MachineNetworks takes precedence
  • No breaking changes to existing APIs or configurations

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 23, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 23, 2025

@danmanor: This pull request references MGMT-21201 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

🎯 Overview

This PR adds comprehensive dual-stack networking support to OpenShift image-based installations, enabling clusters to use both IPv4 and IPv6 networks simultaneously. This addresses the growing need for dual-stack deployments in modern containerized environments.

🚀 Key Features

Dual-Stack Network Configuration Support

  • Multiple Machine Networks: Extended support from single MachineNetwork to multiple MachineNetworks array
  • IPv4 + IPv6 Support: Full support for configuring both IPv4 and IPv6 machine networks
  • Validation Logic: Added comprehensive validation to ensure dual-stack configurations are valid (max 2 networks, one IPv4 + one IPv6)

Smart DHCP Kernel Arguments

  • Automatic DHCP Detection: Intelligently determines when to add DHCP kernel arguments based on network configuration
  • Conditional Logic: Only adds kernel args for dual-stack scenarios (single-stack remains unchanged)
  • User Override Protection: Respects user-provided kernel arguments and avoids duplication
  • Network Config Parsing: Analyzes NetworkManager state configuration to determine static vs. DHCP for each IP version

Enhanced Data Structures

  • Updated SeedReconfiguration: Added MachineNetworks []string field while maintaining backward compatibility with deprecated MachineNetwork
  • Install Config Validation: Extended validation to support dual-stack machine network configurations

Comprehensive Testing

  • Install Config Tests: 189+ lines of new test cases covering dual-stack scenarios
  • Ignition Tests: 354+ lines of new tests including DHCP kernel argument logic
  • Test Infrastructure: Improved test setup with proper resource management
  • Edge Cases: Coverage for mixed static/DHCP, user-provided args, and validation scenarios

🔧 Technical Implementation

DHCP Kernel Arguments Logic

// Only adds kernel args for dual-stack scenarios
if len(machineNetworks) == 2 && hasIPv4 && hasIPv6 {
   // Analyzes networkConfig to determine what needs DHCP
   // Returns: "ip=dhcp", "ip=dhcp6", "ip=dhcp,dhcp6", or ""
}

Machine Networks Migration

// Before: Single network only
cc.Config.MachineNetwork = networks[0].CIDR.String()

// After: Support for multiple networks
funk.ForEach(networks, func(net *types.MachineNetworkEntry) {
   cc.Config.MachineNetworks = append(cc.Config.MachineNetworks, net.CIDR.String())
})

✅ Validation & Testing

  • ✅ All existing tests pass
  • ✅ New dual-stack test scenarios added
  • ✅ Backward compatibility maintained
  • ✅ Edge cases covered (single-stack, invalid configs, user overrides)

🔄 Backward Compatibility

  • Maintains full backward compatibility with existing single-stack configurations
  • Deprecated MachineNetwork field still supported but MachineNetworks takes precedence
  • No breaking changes to existing APIs or configurations

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.

@danmanor danmanor changed the title MGMT-21201: Enable dual-stack clusters with image-based installations / upgrades WIP: MGMT-21201: Enable dual-stack clusters with image-based installations / upgrades Jul 23, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 23, 2025
@openshift-ci openshift-ci bot requested review from javipolo and mresvanis July 23, 2025 06:47
@danmanor danmanor changed the title WIP: MGMT-21201: Enable dual-stack clusters with image-based installations / upgrades WIP: MGMT-21201: Enable dual-stack clusters with image-based installations Jul 23, 2025
@danmanor danmanor force-pushed the enable-dual-stack branch 4 times, most recently from b186baa to bb8093f Compare July 23, 2025 09:22
@danmanor danmanor changed the title WIP: MGMT-21201: Enable dual-stack clusters with image-based installations WIP: MGMT-21212: Enable dual-stack clusters with image-based installations Jul 23, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 23, 2025

@danmanor: This pull request references MGMT-21212 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

🎯 Overview

This PR adds comprehensive dual-stack networking support to OpenShift image-based installations, enabling clusters to use both IPv4 and IPv6 networks simultaneously. This addresses the growing need for dual-stack deployments in modern containerized environments.

🚀 Key Features

Dual-Stack Network Configuration Support

  • Multiple Machine Networks: Extended support from single MachineNetwork to multiple MachineNetworks array
  • IPv4 + IPv6 Support: Full support for configuring both IPv4 and IPv6 machine networks
  • Validation Logic: Added comprehensive validation to ensure dual-stack configurations are valid (max 2 networks, one IPv4 + one IPv6)

Smart DHCP Kernel Arguments

  • Automatic DHCP Detection: Intelligently determines when to add DHCP kernel arguments based on network configuration
  • Conditional Logic: Only adds kernel args for dual-stack scenarios (single-stack remains unchanged)
  • User Override Protection: Respects user-provided kernel arguments and avoids duplication
  • Network Config Parsing: Analyzes NetworkManager state configuration to determine static vs. DHCP for each IP version

Enhanced Data Structures

  • Updated SeedReconfiguration: Added MachineNetworks []string field while maintaining backward compatibility with deprecated MachineNetwork
  • Install Config Validation: Extended validation to support dual-stack machine network configurations

Comprehensive Testing

  • Install Config Tests: 189+ lines of new test cases covering dual-stack scenarios
  • Ignition Tests: 354+ lines of new tests including DHCP kernel argument logic
  • Test Infrastructure: Improved test setup with proper resource management
  • Edge Cases: Coverage for mixed static/DHCP, user-provided args, and validation scenarios

🔧 Technical Implementation

DHCP Kernel Arguments Logic

// Only adds kernel args for dual-stack scenarios
if len(machineNetworks) == 2 && hasIPv4 && hasIPv6 {
   // Analyzes networkConfig to determine what needs DHCP
   // Returns: "ip=dhcp", "ip=dhcp6", "ip=dhcp,dhcp6", or ""
}

Machine Networks Migration

// Before: Single network only
cc.Config.MachineNetwork = networks[0].CIDR.String()

// After: Support for multiple networks
funk.ForEach(networks, func(net *types.MachineNetworkEntry) {
   cc.Config.MachineNetworks = append(cc.Config.MachineNetworks, net.CIDR.String())
})

✅ Validation & Testing

  • ✅ All existing tests pass
  • ✅ New dual-stack test scenarios added
  • ✅ Backward compatibility maintained
  • ✅ Edge cases covered (single-stack, invalid configs, user overrides)

🔄 Backward Compatibility

  • Maintains full backward compatibility with existing single-stack configurations
  • Deprecated MachineNetwork field still supported but MachineNetworks takes precedence
  • No breaking changes to existing APIs or configurations

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-robot
Copy link
Contributor

openshift-ci-robot commented Jul 23, 2025

@danmanor: This pull request references MGMT-21212 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

🎯 Overview

This PR adds comprehensive dual-stack networking support to OpenShift image-based installations, enabling clusters to use both IPv4 and IPv6 networks simultaneously. This addresses the growing need for dual-stack deployments in modern containerized environments.

🚀 Key Features

Dual-Stack Network Configuration Support

  • Multiple Machine Networks: Extended support from single MachineNetwork to multiple MachineNetworks array
  • IPv4 + IPv6 Support: Full support for configuring both IPv4 and IPv6 machine networks
  • Validation Logic: Added comprehensive validation to ensure dual-stack configurations are valid (max 2 networks, one IPv4 + one IPv6)

Smart DHCP Kernel Arguments

  • Automatic DHCP Detection: Intelligently determines when to add DHCP kernel arguments based on network configuration
  • Conditional Logic: Only adds kernel args for dual-stack scenarios (single-stack remains unchanged)
  • User Override Protection: Respects user-provided kernel arguments and avoids duplication
  • Network Config Parsing: Analyzes NetworkManager state configuration to determine static vs. DHCP for each IP version

Enhanced Data Structures

  • Updated SeedReconfiguration: Added MachineNetworks []string field while maintaining backward compatibility with deprecated MachineNetwork
  • Install Config Validation: Extended validation to support dual-stack machine network configurations

Comprehensive Testing

  • Install Config Tests: 189+ lines of new test cases covering dual-stack scenarios
  • Ignition Tests: 354+ lines of new tests including DHCP kernel argument logic
  • Test Infrastructure: Improved test setup with proper resource management
  • Edge Cases: Coverage for mixed static/DHCP, user-provided args, and validation scenarios

✅ Validation & Testing

  • ✅ All existing tests pass
  • ✅ New dual-stack test scenarios added
  • ✅ Backward compatibility maintained
  • ✅ Edge cases covered (single-stack, invalid configs, user overrides)

🔄 Backward Compatibility

  • Maintains full backward compatibility with existing single-stack configurations
  • Deprecated MachineNetwork field still supported but MachineNetworks takes precedence
  • No breaking changes to existing APIs or configurations

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.

@danmanor danmanor force-pushed the enable-dual-stack branch from bb8093f to ce09fd3 Compare July 23, 2025 14:08
@danmanor
Copy link
Contributor Author

/retest

@danmanor danmanor force-pushed the enable-dual-stack branch from ce09fd3 to 2908585 Compare July 28, 2025 14:43
@danmanor danmanor requested a review from eranco74 July 28, 2025 14:46
@danmanor
Copy link
Contributor Author

/retest

@danmanor danmanor changed the title WIP: MGMT-21212: Enable dual-stack clusters with image-based installations MGMT-21212: Enable dual-stack clusters with image-based installations Jul 29, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2025
@mresvanis
Copy link
Contributor

mresvanis commented Jul 29, 2025

Thanks for the contribution @danmanor! Do you think we can add the respective integration tests for this change?

The integration tests for the imagebased subcommand can be found here. These tests are based on github.com/rogpeppe/go-internal/testscript and can be executed locally via ./hack/go-integration-test.sh.

@danmanor danmanor force-pushed the enable-dual-stack branch from 2908585 to 59a906a Compare July 30, 2025 14:00
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 30, 2025

@danmanor: This pull request references MGMT-21212 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

🎯 Overview

This PR adds comprehensive dual-stack networking support to OpenShift image-based installations, enabling clusters to use both IPv4 and IPv6 networks simultaneously. This addresses the growing need for dual-stack deployments in modern containerized environments.

🚀 Key Features

Dual-Stack Network Configuration Support

  • Multiple Machine Networks: Extended support from single MachineNetwork to multiple MachineNetworks array
  • IPv4 + IPv6 Support: Full support for configuring both IPv4 and IPv6 machine networks
  • Validation Logic: Added comprehensive validation to ensure dual-stack configurations are valid (max 2 networks, one IPv4 + one IPv6)

Enhanced Data Structures

  • Updated SeedReconfiguration: Added MachineNetworks []string field while maintaining backward compatibility with deprecated MachineNetwork
  • Install Config Validation: Extended validation to support dual-stack machine network configurations

Comprehensive Testing

  • Install Config Tests: 189+ lines of new test cases covering dual-stack scenarios
  • Test Infrastructure: Improved test setup with proper resource management
  • Edge Cases: Coverage for mixed static/DHCP, user-provided args, and validation scenarios

✅ Validation & Testing

  • ✅ All existing tests pass
  • ✅ New dual-stack test scenarios added
  • ✅ Backward compatibility maintained
  • ✅ Edge cases covered (single-stack, invalid configs, user overrides)

🔄 Backward Compatibility

  • Maintains full backward compatibility with existing single-stack configurations
  • Deprecated MachineNetwork field still supported but MachineNetworks takes precedence
  • No breaking changes to existing APIs or configurations

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.

@danmanor danmanor force-pushed the enable-dual-stack branch from 0abe9b6 to eeedb75 Compare July 31, 2025 07:46
@danmanor
Copy link
Contributor Author

/retest

3 similar comments
@danmanor
Copy link
Contributor Author

danmanor commented Aug 1, 2025

/retest

@danmanor
Copy link
Contributor Author

danmanor commented Aug 3, 2025

/retest

@danmanor
Copy link
Contributor Author

danmanor commented Aug 5, 2025

/retest

@mresvanis
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 6, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mresvanis

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 Aug 6, 2025
@eranco74
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2025
@danmanor
Copy link
Contributor Author

/retest

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 990be59 and 2 for PR HEAD eeedb75 in total

@danmanor
Copy link
Contributor Author

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 13, 2025

@danmanor: 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-vsphere-host-groups-ovn-custom-no-upgrade eeedb75 link false /test e2e-vsphere-host-groups-ovn-custom-no-upgrade
ci/prow/e2e-vsphere-ovn-multi-network-techpreview eeedb75 link false /test e2e-vsphere-ovn-multi-network-techpreview
ci/prow/e2e-vsphere-host-groups-ovn-techpreview eeedb75 link false /test e2e-vsphere-host-groups-ovn-techpreview

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.

@openshift-merge-bot openshift-merge-bot bot merged commit e3cbeaf into openshift:main Aug 13, 2025
20 of 21 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-installer
This PR has been included in build ose-installer-container-v4.20.0-202508131414.p0.ge3cbeaf.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-baremetal-installer
This PR has been included in build ose-baremetal-installer-container-v4.20.0-202508131414.p0.ge3cbeaf.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-artifacts
This PR has been included in build ose-installer-artifacts-container-v4.20.0-202508131414.p0.ge3cbeaf.assembly.stream.el9.
All builds following this will include this PR.

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. 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