Skip to content

[release-4.17] OCPBUGS-52951: Unexpected Behavior During Cluster Upgrade for the ovn-ipsec-host pods - #2654

Merged
openshift-merge-bot[bot] merged 18 commits into
openshift:release-4.17from
pperiyasamy:ipsec-graceful-cleanup-4.17
Mar 31, 2025
Merged

[release-4.17] OCPBUGS-52951: Unexpected Behavior During Cluster Upgrade for the ovn-ipsec-host pods#2654
openshift-merge-bot[bot] merged 18 commits into
openshift:release-4.17from
pperiyasamy:ipsec-graceful-cleanup-4.17

Conversation

@pperiyasamy

@pperiyasamy pperiyasamy commented Feb 26, 2025

Copy link
Copy Markdown
Member

Backport of #2644.

Resolved Conflicts:

5762c31: pkg/controller/statusmanager/status_manager.go (needed to import k8s.io/apimachinery/pkg/util/sets)
5762c31 and bf7e75d: pkg/network/ovn_kubernetes_test.go (conflict with existing import packages).

/assign @huiran0826

@openshift-ci-robot openshift-ci-robot added 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 Feb 26, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: This pull request references Jira Issue OCPBUGS-50582, which is invalid:

  • expected the bug to target either version "4.17." or "openshift-4.17.", but it targets "4.18.z" instead
  • expected dependent Jira Issue OCPBUGS-50616 to target a version in 4.18.0, but it targets "4.19.0" instead

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:

Backport of #2644. No conflict seen.
/assign @huiran0826

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 changed the title [release-4.17] OCPBUGS-50582: Graceful cleanup of IPsec states [release-4.17] Graceful cleanup of IPsec states Feb 26, 2025
@openshift-ci-robot openshift-ci-robot removed the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 26, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

Details

In response to this:

Backport of #2644. No conflict seen.
/assign @huiran0826

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 openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Feb 26, 2025
@openshift-ci
openshift-ci Bot requested review from jcaamano and kyrtapz February 26, 2025 09:01
@pperiyasamy

Copy link
Copy Markdown
Member Author

@huiran0826 This PR may help for your upgrade testing for #2644.

@pperiyasamy pperiyasamy changed the title [release-4.17] Graceful cleanup of IPsec states [release-4.17] OCPBUGS-52951: Unexpected Behavior During Cluster Upgrade for the ovn-ipsec-host pods Mar 11, 2025
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate 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 Mar 11, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: This pull request references Jira Issue OCPBUGS-52951, 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 dependent Jira Issue OCPBUGS-52949 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is New instead

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:

Backport of #2644.

Resolved Conflicts:

pkg/controller/statusmanager/status_manager.go (needed to import k8s.io/apimachinery/pkg/util/sets)
pkg/network/ovn_kubernetes_test.go (conflict with existing import packages)

/assign @huiran0826

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 ipsec-graceful-cleanup-4.17 branch from 09801dc to 6187ec8 Compare March 20, 2025 11:46
@pperiyasamy

Copy link
Copy Markdown
Member Author

/assign @anuragthehatter

@anuragthehatter

Copy link
Copy Markdown

Looks good on QE tests as per steps

@anuragthehatter

Copy link
Copy Markdown

/label qe-approved

@openshift-ci openshift-ci Bot added the qe-approved Signifies that QE has signed off on this PR label Mar 24, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: This pull request references Jira Issue OCPBUGS-52951, which is invalid:

  • expected dependent Jira Issue OCPBUGS-52949 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

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:

Backport of #2644.

Resolved Conflicts:

pkg/controller/statusmanager/status_manager.go (needed to import k8s.io/apimachinery/pkg/util/sets)
pkg/network/ovn_kubernetes_test.go (conflict with existing import packages)

/assign @huiran0826

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.

@huiran0826

Copy link
Copy Markdown

/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 Mar 28, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@huiran0826: This pull request references Jira Issue OCPBUGS-52951, 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.17.z) matches configured target version for branch (4.17.z)
  • 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-52949 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-52949 targets the "4.18.z" version, which is one of the valid target versions: 4.18.0, 4.18.z
  • bug has dependents

Requesting review from QA contact:
/cc @anuragthehatter

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.

@openshift-ci
openshift-ci Bot requested a review from anuragthehatter March 28, 2025 08:09
pperiyasamy and others added 9 commits March 31, 2025 11:14
This reverts commit 763c565.

(cherry picked from commit cab04d3)
(cherry picked from commit 083bb1e)
This replaces informer with source.Kind for machine config
watcher which helps to make use of same cache used for the
manager.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit 97309ac)
(cherry picked from commit 1484a6a)
This commit captures machine config delete event, watches machine config pool
while removing machine config from the cluster and reflect machine config pool
status conditions into network status.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit b3c03e4)
(cherry picked from commit 717548e)
When network operator owned machine config is deleted, though mco is still deleting
the rendered machine config from the machine config pool, there is no way to lookup
owner reference on the machine config object upon network operator pod reboot caused
by node reboot. This commit writes machine config rendering status onto
network.operator.openshift.io/last-seen-machineconfig-state network co annotation
and this is being looked up to report status accordingly.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit 080f445)
(cherry picked from commit 79e7d3e)
This commit removes unnecessary initialization of machine config cache
while handling events, cleans up cache entry at the right time,  better
handling of variable names, errors and adds few doc comments.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit b99b606)
(cherry picked from commit 541ca8f)
When a machine config pool is in a paused state, then it doesn't process any
machine config. so during legacy IPsec upgrade (4.14->4.15), IPsec machine
configs may not be installed on the nodes when its pool is in paused state.
In those cases the network operator continues to render older IPsec daemonsets
which blocks network components from not getting upgraded to newer versions.
Hence this commit renders newer IPsec daemonsets immediately, with new
IPsecCheckForLibreswan check ensures one of the pods serves IPsec for the
node. When MCPs are fully rolled out with ipsec machine config, then it
goes ahead with rendering only host flavored IPsec daemonset.

It brings in new behavior on IPsec daemonset rendering during IPsec deployment,
upgrade and node reboot scenarios.

1. Users would notice both daemonsets being rendered at the time of IPsec install
(or) upgrade for a temporary period until IPsec machine configs are fully deployed.
2. At the time of node reboot or machine config pool goes into progressing state,
both demonsets being rendered. In this scenario, the containerized ipsec daemonset
pods are dormant.
3. It removes legacy upgrade case as every upgrade would be considered as the
same with this approach.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit 37693e9)
(cherry picked from commit 2ddaf1c)
The previous commit c12cdd4 renders ipsec host
daemonset even before machine config are deployed on the node, the ipsec host
paths /usr/sbin/ipsec and /usr/libexec/ipsec on the are not available until
libreswan installed on the node. So pod fails to come up and goes into pending
state because host volume doesn't exist and network co is blocked from moving
from a progressing state to an available state. To fix this problem, mount its
top level directory into ovn-ipsec container which is a system level directory
which is always present.

During OCP upgrade from previous 4.15.z to this fix release, with worker pool is
in paused state, both network and machine config cluster operator are upgraded
into this fix release, the new host ipsec deployment is rendered which has
libreswan 4.6 package installed on the container. Since worker node are paused,
the host is still having libreswan 4.9 package installed and pluto is with this
version. But this is not a problem with this commit, we mount /usr/sbin and
/usr/libexec directories, The /usr/sbin/ipsec, /usr/libexec/ipsec/addconn and
/usr/libexec/ipsec/_stackmanager commands are used inside the container.
The ipsec and _stackmanager are bash scripts which should work without a problem.
The addconn is a "C" compiled binary having some dynamic library dependencies and
the container uses this command to validate /etc/ipsec.conf file. This must also
work because /usr/libexec/ipsec mount was there previously as well.

sh-5.1# ldd /usr/sbin/ipsec
	not a dynamic executable
sh-5.1# ldd /usr/libexec/ipsec/_stackmanager
	not a dynamic executable
sh-5.1# ldd /usr/libexec/ipsec/addconn
	linux-vdso.so.1 (0x00007ffc87bf7000)
	libunbound.so.8 => /lib64/libunbound.so.8 (0x00007f809f5f3000)
	libldns.so.3 => /lib64/libldns.so.3 (0x00007f809f58b000)
	libseccomp.so.2 => /lib64/libseccomp.so.2 (0x00007f809f56b000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f809f200000)
	libssl.so.3 => /lib64/libssl.so.3 (0x00007f809f4c5000)
	libprotobuf-c.so.1 => /lib64/libprotobuf-c.so.1 (0x00007f809f4ba000)
	libevent-2.1.so.7 => /lib64/libevent-2.1.so.7 (0x00007f809f45f000)
	libpython3.9.so.1.0 => /lib64/libpython3.9.so.1.0 (0x00007f809ee00000)
	libcrypto.so.3 => /lib64/libcrypto.so.3 (0x00007f809e800000)
	libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007f809f435000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f809f7b3000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f809ed25000)
	libz.so.1 => /lib64/libz.so.1 (0x00007f809f41b000)

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit 865ac69)
(cherry picked from commit 91a6b78)
The CNO started using machine configs from 4.15 for IPsec deployment, so adding
a check for machine config operator to be at least >= 4.15 to roll out IPsec
machine configs. Otherwise during OCP 4.14->4.15 upgrade, even before MCO is
upgraded to 4.15, IPsec machine configs are rolled out, it uses ipsec extension
from 4.14 version to install packages, installs libreswan 4.9 version on the
node intermeditately. So this MCO version check ensures IPsec machine configs
are rendered after MCO is upgraded to 4.15 and nodes get desired libreswan
version 4.6.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit cb99bc3)
(cherry picked from commit c8f4cf8)
The rpm db directory is different on rhcos and rhel workers, so mounting
/usr/share/rpm directory will not work for rhel worker nodes. To avoid
this, this commit checks on ipsec systemd service on the host to decide
which ipsec deployment to be active or dormant.

Signed-off-by: Periyasamy Palanisamy <pepalani@redhat.com>
(cherry picked from commit 11c08e6)
(cherry picked from commit 1abd78b)
@pperiyasamy
pperiyasamy force-pushed the ipsec-graceful-cleanup-4.17 branch from 6187ec8 to 9c969cc Compare March 31, 2025 09:26
@jcaamano

Copy link
Copy Markdown
Contributor

/lgtm
/approve
/label backport-risk-assessed

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Mar 31, 2025
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 31, 2025
@openshift-ci

openshift-ci Bot commented Mar 31, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 Mar 31, 2025
@huiran0826

Copy link
Copy Markdown

/label cherry-pick-approved

@openshift-ci openshift-ci Bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Mar 31, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 8f0b637 and 2 for PR HEAD 9c969cc in total

@openshift-ci

openshift-ci Bot commented Mar 31, 2025

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/e2e-aws-ovn-ipsec-upgrade 6187ec8 link false /test e2e-aws-ovn-ipsec-upgrade
ci/prow/4.17-upgrade-from-stable-4.16-e2e-gcp-ovn-upgrade 9c969cc link false /test 4.17-upgrade-from-stable-4.16-e2e-gcp-ovn-upgrade
ci/prow/4.17-upgrade-from-stable-4.16-e2e-azure-ovn-upgrade 9c969cc link false /test 4.17-upgrade-from-stable-4.16-e2e-azure-ovn-upgrade
ci/prow/e2e-aws-ovn-single-node 9c969cc link false /test e2e-aws-ovn-single-node
ci/prow/e2e-vsphere-ovn 9c969cc link false /test e2e-vsphere-ovn
ci/prow/e2e-azure-ovn 9c969cc link false /test e2e-azure-ovn
ci/prow/e2e-aws-hypershift-ovn-kubevirt 9c969cc link false /test e2e-aws-hypershift-ovn-kubevirt
ci/prow/security 9c969cc link false /test security
ci/prow/e2e-vsphere-ovn-dualstack-primaryv6 9c969cc link false /test e2e-vsphere-ovn-dualstack-primaryv6

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 cf90595 into openshift:release-4.17 Mar 31, 2025
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@pperiyasamy: Jira Issue OCPBUGS-52951: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-52951 has been moved to the MODIFIED state.

Details

In response to this:

Backport of #2644.

Resolved Conflicts:

5762c31: pkg/controller/statusmanager/status_manager.go (needed to import k8s.io/apimachinery/pkg/util/sets)
5762c31 and bf7e75d: pkg/network/ovn_kubernetes_test.go (conflict with existing import packages).

/assign @huiran0826

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

Copy link
Copy Markdown
Contributor

[ART PR BUILD NOTIFIER]

Distgit: cluster-network-operator
This PR has been included in build cluster-network-operator-container-v4.17.0-202503311836.p0.gcf90595.assembly.stream.el9.
All builds following this will include this PR.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in accepted release 4.18.0-0.nightly-2025-04-17-181105

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

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/severity-moderate Referenced Jira bug's severity is moderate 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. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.