Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pperiyasamy
Copy link
Member

@pperiyasamy pperiyasamy commented Feb 25, 2025

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.

@pperiyasamy
Copy link
Member Author

/retest-required

1 similar comment
@pperiyasamy
Copy link
Member Author

/retest-required

Copy link
Contributor

openshift-ci bot commented Mar 11, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pperiyasamy
Once this PR has been reviewed and has the lgtm label, please assign djoshy for approval. For more information see the Code Review Process.

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

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

@pperiyasamy
Copy link
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
Copy link
Contributor

openshift-ci-robot commented Mar 11, 2025

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

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
Member Author

/assign @jcaamano

@pperiyasamy
Copy link
Member Author

/retest

@pperiyasamy
Copy link
Member Author

/assign @huiran0826 @anuragthehatter @tssurya

@openshift-ci-robot
Copy link
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.

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

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

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
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
Member Author

/retest

@pperiyasamy pperiyasamy changed the title SDN-5330: Add openvswitch-ipsec package into ipsec plugin CORENET-5972: Add openvswitch-ipsec package into ipsec plugin Apr 30, 2025
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Apr 30, 2025

@pperiyasamy: This pull request references CORENET-5972 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.

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.

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

Note that this openvswitch-ipsec package name must be updated
for every OVS x.y version bump which may be done for every OCP
release.

Signed-off-by: Periyasamy Palanisamy <[email protected]>
The openvswitch-ipsec 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 <[email protected]>
@pperiyasamy pperiyasamy force-pushed the openvswitch-ipsec branch from 969b039 to 815640a Compare May 7, 2025 07:11
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 <[email protected]>
Copy link
Contributor

openshift-ci bot commented May 8, 2025

@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/okd-scos-e2e-aws-ovn 1d65cd3 link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-gcp-op-ocl 1d65cd3 link false /test e2e-gcp-op-ocl
ci/prow/e2e-gcp-op-single-node 1d65cd3 link true /test e2e-gcp-op-single-node
ci/prow/e2e-azure-ovn-upgrade-out-of-change 1d65cd3 link false /test e2e-azure-ovn-upgrade-out-of-change
ci/prow/e2e-hypershift 1d65cd3 link true /test e2e-hypershift

Full PR test history. Your PR dashboard.

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
jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants