Skip to content

CORENET-5972: Add openvswitch-ipsec package into ipsec plugin - #4878

Merged
openshift-merge-bot[bot] merged 4 commits into
openshift:mainfrom
pperiyasamy:openvswitch-ipsec
Jul 21, 2026
Merged

CORENET-5972: Add openvswitch-ipsec package into ipsec plugin#4878
openshift-merge-bot[bot] merged 4 commits into
openshift:mainfrom
pperiyasamy:openvswitch-ipsec

Conversation

@pperiyasamy

@pperiyasamy pperiyasamy commented Feb 25, 2025

Copy link
Copy Markdown
Member

This PR adds openvswitch3.5-ipsec package support to the ipsec os extension and ensures it integrates correctly for both node install and upgrade scenarios.

  • Adds openvswitch3.5-ipsec to the ipsec os extension’s package list in the supported extension map.
  • Adds proper ordering for openvswitch-ipsec.service: starts after ipsec.service, required before crio and kubelet
  • Updates wait-for-ipsec-connect.service to start openvswitch-ipsec.service immediately when it is already configured for OVS, then waits for IKE SA establishment.
  • Removes the previous workaround in ipsec-connect-wait that manually triggered pluto to establish IKE SAs.
  • Introduces LegacyExtensionPackages() to track prior package lists for extensions whose packages changed from 4.x to 5.x. During upgrade, the new MCD pod may roll out before the OS image update, verification logic now accepts either the current or legacy package set, preventing nodes from degrading during the transition.
  • Removes the early return in applyExtensions so that package-level changes within an extension are detected and applied via rpm-ostree.

Summary by CodeRabbit

Bug Fixes

  • Improved Open vSwitch + IPsec startup ordering and readiness behavior, ensuring the IPsec-related service is enabled/started reliably when Open vSwitch is configured via openshift.conf.
  • Enhanced IPsec connection readiness by deriving expected connections from Open vSwitch/OVN runtime state instead of static config parsing.
  • Improved post-reboot extension package verification to accept both current and legacy valid IPsec package sets, including the new openvswitch3.5-ipsec option.

Tests

  • Added coverage for discovering valid package sets per extension and validating legacy IPsec upgrade scenarios.

@pperiyasamy

Copy link
Copy Markdown
Member Author

/retest-required

1 similar comment
@pperiyasamy

Copy link
Copy Markdown
Member Author

/retest-required

@pperiyasamy

Copy link
Copy Markdown
Member Author

/assign @igsilya

@pperiyasamy pperiyasamy changed the title [DNM] Add openvswitch-ipsec package into ipsec plugin SDN-5330: Add openvswitch-ipsec package into ipsec plugin Mar 11, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 11, 2025
@openshift-ci-robot

openshift-ci-robot commented Mar 11, 2025

Copy link
Copy Markdown
Contributor

@pperiyasamy: This pull request references SDN-5330 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 story to target the "4.19.0" version, but no target version was set.

Details

In response to this:

The ipsec os extension is updated to install openvswitch<ver>-ipsec package in addition to libreswan and NetworkManager-libreswan packages, so this PR updates supported extension map with openvswitch<ver>-ipsec package.

Note that this openvswitch<ver>-ipsec package name must be updated for every OVS x.y version bump which we may need to look out for every OCP major release.

Depends on openshift/os#1718.

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.

@pperiyasamy
pperiyasamy force-pushed the openvswitch-ipsec branch 3 times, most recently from be4805f to 752fd3c Compare March 19, 2025 08:08
@pperiyasamy

Copy link
Copy Markdown
Member Author

/assign @jcaamano

@pperiyasamy

Copy link
Copy Markdown
Member Author

/retest

@pperiyasamy

Copy link
Copy Markdown
Member Author

/assign @huiran0826 @anuragthehatter @tssurya

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: This pull request references SDN-5330 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 story to target the "4.19.0" version, but no target version was set.

Details

In response to this:

The ipsec os extension (openshift/os#1718) is updated to include openvswitch3.5-ipsec package in addition to libreswan and NetworkManager-libreswan packages in the ipsec os extension, so this PR updates supported extension map with openvswitch3.5-ipsec package so that it would be installed on the node ipsec extension is rolled out with a machine config. Note that this openvswitch3.5-ipsec package name must be updated for every OVS version bump which we may need to look out for every OCP major release. We should also explore possibility of using wildcard string openvswitch*-ipsec to see if it works. This can avoid update on MCO for every OVS version bump. We are discussing it here: https://redhat-internal.slack.com/archives/C02CZNQHGN8/p1743594990076039.

The commit 978484b only gets openvswitch3.5-ipsec package installed on the node, So the CNO PR openshift/cluster-network-operator#2662 gets openvswitch-ipsec.service deployed on the node only when required (i.e. at the time of IPsec deployment). So the commit 3b34da7 adds required service dependencies for openvswitch-ipsec.service (it must be started only after ipsec.service and it has to be up before crio and kubelet service). It also removes a workaround that was needed in ipsec-connect-wait script to explicitly trigger pluto to establish IPSec IKE SAs with
peer nodes when openvswitch-ipsec.service is already running on the node and adds required wait until openvswitch-ipsec.service populates /etc/ipsec.d/openshift.conf file.

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.

Comment on lines +35 to +44
if systemctl is-active --quiet $ovsipsecsvc; then
# When openvswitch-ipsec.service is active (i.e. IPsec is enabled for
# east west traffic), the service may be just started before
# wait-for-ipsec-connect.service, it may take a while to populate
# /etc/ipsec.d/openshift.conf with IPsec connection entries.
# so retrieve connection names from ovs.
desiredconn=$(ovs-vsctl --columns=name find interface type=geneve | awk -F': ' '/name/ {print $2}' | sort | awk '{print $0"-in-1", $0"-out-1"}' | tr '\n' ' ')
else
desiredconn=$(grep -E '^\s*conn\s+' /etc/ipsec.d/openshift.conf | grep -v '%default' | awk '{print $2}' | tr ' ' '\n' | sort | tr '\n' ' ')
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The ovs-vsctl method should work in both cases, so maybe just always use it instead of parsing openshift.conf?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@igsilya when ipsec is disabled, openvswitch-ipsec.service is stopped, openvswitch3.5-ipsec package is removed, but /etc/ipsec.d/openshift.conf file is not removed (though file doesn't have ipsec conn entries). so using ovs-vsctl method would just unnecessarily checking for established ipsec connections for 60s which is not configured anyway. that is the reason parsing openshift.conf for this case.
now thinking about moving from Full->External ipsec scenario, node will keep openvswitch-ipsec.service running, script uses ovs-vsctl method and unnecessarily adds 60s delay.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If ipsec is disabled in OVN, then those tunnels should not have ipsec configuration. Can we filter by remote_cert being non-empty, for example? Something like:

ovs-vsctl --columns=name find interface type=geneve options:remote_cert!='""'

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes @igsilya, filtering tunnels on remote_name would handle both cases, thanks ! updated the script.

@pperiyasamy
pperiyasamy force-pushed the openvswitch-ipsec branch 3 times, most recently from c8463d1 to 969b039 Compare April 15, 2025 11:13
@pperiyasamy

Copy link
Copy Markdown
Member Author

/retest

@pperiyasamy
pperiyasamy force-pushed the openvswitch-ipsec branch 2 times, most recently from 6b8d976 to c04cebe Compare July 16, 2026 11:30
@pperiyasamy

Copy link
Copy Markdown
Member Author

/pipeline required

@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-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-gcp-op-ocl-part1
/test e2e-gcp-op-ocl-part2
/test e2e-gcp-op-part1
/test e2e-gcp-op-part2
/test e2e-gcp-op-single-node
/test e2e-hypershift

@igsilya

igsilya commented Jul 16, 2026

Copy link
Copy Markdown

@pperiyasamy I'm not an expert in the extension packages management parts, but the systemd service related code seems correct to me, if we're OK with the oneshot waiting service reported as failed in relatively common cases (multi-node reboots).

@jcaamano

Copy link
Copy Markdown
Contributor

lgtm

@pperiyasamy

Copy link
Copy Markdown
Member Author

/retest

The ipsec os extension is updated to install openvswitch3.5-ipsec
package in addition to libreswan and NetworkManager-libreswan
packages, so this commit updates supported extension map with
openvswitch-ipsec package.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
The openvswitch-ipsec service must be started only after ipsec.service
and it has to be up before crio and kubelet service, so add appropriate
systemd service dependencies for openvswitch-ipsec.service.

It also removes a workaround that was needed in ipsec-connect-wait
script to explicitly trigger pluto to establish IPSec IKE SAs with
peer nodes when openvswitch-ipsec.service is already running on
the node.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
When openvswith-ipsec systemd service is already configured for OVN, then let
wait-for-ipsec-connect.service start it immediately and then start waiting
for IKE SA to be established.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
Add openvswitch3.5-ipsec to the ipsec extension and implement graceful
handling of extension package changes during upgrade.

During an upgrade, the new MCD code may roll out before the OS image
update. If an extension’s package list has changed, this creates a
window where the new MCD expects packages that aren’t yet installed,
causing nodes to become degraded.

Introduce LegacyExtensionPackages() to track previous package lists
and modify verification logic to accept either current or legacy
package sets. This allows nodes to pass verification during the
upgrade transition period.

AssistedBy: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
@jcaamano

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 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-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-gcp-op-ocl-part1
/test e2e-gcp-op-ocl-part2
/test e2e-gcp-op-part1
/test e2e-gcp-op-part2
/test e2e-gcp-op-single-node
/test e2e-hypershift

@igsilya

igsilya commented Jul 17, 2026

Copy link
Copy Markdown

I have no power in this repo, but /lgtm as well.

@pperiyasamy

Copy link
Copy Markdown
Member Author

/retest

@djoshy

djoshy commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: djoshy, igsilya, jcaamano, pperiyasamy

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 Jul 17, 2026
@pperiyasamy

Copy link
Copy Markdown
Member Author

/verified in ci

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: The /verified command must be used with one of the following actions: by, later, remove, or bypass. See https://docs.ci.openshift.org/docs/architecture/jira/#premerge-verification for more information.

Details

In response to this:

/verified in ci

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.

@pperiyasamy

Copy link
Copy Markdown
Member Author

/verified by ci

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 19, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: This PR has been marked as verified by ci.

Details

In response to this:

/verified by ci

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-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD d1b589a and 2 for PR HEAD dd59b42 in total

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@pperiyasamy: 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/okd-images e71356f link true /test okd-images
ci/prow/4.12-upgrade-from-stable-4.11-images e71356f link true /test 4.12-upgrade-from-stable-4.11-images
ci/prow/e2e-aws-serial 49a100b link false /test e2e-aws-serial
ci/prow/e2e-gcp-op 49a100b link true /test e2e-gcp-op
ci/prow/e2e-azure-ovn-upgrade-out-of-change 49a100b link false /test e2e-azure-ovn-upgrade-out-of-change
ci/prow/e2e-gcp-op-ocl 49a100b link false /test e2e-gcp-op-ocl
ci/prow/e2e-azure-ovn-upgrade 49a100b link false /test e2e-azure-ovn-upgrade

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.

@jcaamano

Copy link
Copy Markdown
Contributor

/retest-required

@openshift-merge-bot
openshift-merge-bot Bot merged commit e4adb96 into openshift:main Jul 21, 2026
17 checks passed
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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants