Skip to content
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

Upgrade changes for OVN IC #2656

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

vthapar
Copy link
Contributor

@vthapar vthapar commented Aug 23, 2023

When a submariner installation upgrades from legacy non-OVN-IC version to an OVN-IC version, cleanup resources created by legacy installation.

Fixes submariner-io/enhancements#193

@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr2656/vthapar/ovn-ic-upgrades
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@vthapar vthapar self-assigned this Aug 23, 2023
@vthapar vthapar force-pushed the ovn-ic-upgrades branch 2 times, most recently from 3384efa to 36ef528 Compare August 23, 2023 12:48
aswinsuryan
aswinsuryan previously approved these changes Aug 23, 2023
@@ -88,6 +88,8 @@ func (ovn *Handler) GetNetworkPlugins() []string {
}

func (ovn *Handler) Init() error {
ovn.LegacyCleanup()
Copy link
Member

Choose a reason for hiding this comment

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

LegacyCleanup is deleting the ovn-k8s-sub0 and br-submariner interfaces.
What about the flows like Logical Router policies that are programmed in the ovn_cluster_router and submariner_router ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aswinsuryan Can correct if my understanding is wrong, but those exist only on node where NetworkPluginSyncer was running and will be removed as part of Cleanup when NetworkPluginSyncer is "stopped" as part of upgrade process.

This LegacyCleanup is for resources that are created on all nodes as part of RouteAgent and is not covered by NetowrkPluginSyncer's cleanup.

Copy link
Contributor

Choose a reason for hiding this comment

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

ya that is right , the changes done here submariner-io/submariner-operator#2759 , will delete any networkplugin-syncer deployment if found and that should cleanup the routes added to ovn routers.

Copy link
Contributor

@tpantelis tpantelis Aug 24, 2023

Choose a reason for hiding this comment

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

@aswinsuryan Are you assuming the operator will initiate the uninstall process for the networkplugin-syncer? If so, this is not (currently) the case - the operator just deletes the networkplugin-syncer deployment.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh ok , I was thinking on delete Stop would be called. If that is not the case we will have to add it here.

Copy link
Member

Choose a reason for hiding this comment

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

Also it is not sure if OVN is going to preserve these flows that submariner have created when it changes from non-ic to ic, as it is not OVN created flows.

Good point. We have to understand how OVN-IC upgrade happens, whether it will read the etcd and change the state of the system to match it or if it uses the info from the NBDB/SBDB.

We may have to test it to see the state after an upgrade.

Normally for a regular linux interface, when its deleted the associated routes/ips on that interface are deleted. In case of OVN, when br-submariner is deleted, does the associated openflow rules get deleted or remain as stale rules?

Another way is to use a logic similar to here on startup to delete the flows. Like if the CIDR and priority matches but nethop does not delete the flow.

Are you suggesting that we do this while programming the required flows or as part of init() operation?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so it sounds like you think we should do whatever legacy NPS cleanup is needed here.

Yes that is right

Copy link
Contributor

Choose a reason for hiding this comment

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

Also it is not sure if OVN is going to preserve these flows that submariner have created when it changes from non-ic to ic, as it is not OVN created flows.

Good point. We have to understand how OVN-IC upgrade happens, whether it will read the etcd and change the state of the system to match it or if it uses the info from the NBDB/SBDB.

We may have to test it to see the state after an upgrade.

Normally for a regular linux interface, when its deleted the associated routes/ips on that interface are deleted. In case of OVN, when br-submariner is deleted, does the associated openflow rules get deleted or remain as stale rules?

Ya right it should get deleted when we remove ovn-k8s-sub0

Another way is to use a logic similar to here on startup to delete the flows. Like if the CIDR and priority matches but nethop does not delete the flow.

Are you suggesting that we do this while programming the required flows or as part of init() operation?

As a part of init().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I gave more thought on it , I think calling it from nps may not work too. If the OVN changes from non-IC to IC , nps cannot connect to ovn db the way it does now . Also it is not sure if OVN is going to preserve these flows that submariner have created when it changes from non-ic to ic, as it is not OVN created flows.

Is that a valid upgrade path? Upgrading from non-ic to ic before upgrading means deployment will be using an unsupported deployment of Submariner [< 0.16 with ic]. Proper way to upgrade should be to upgrade Submariner to 0.16+ before upgrading to IC coz 0.16 is only one that supports IC and non IC both.

We may have to test it to see the state after an upgrade.

But for a submariner upgrade for Opeshift < 4.14 this would work.

So, requiring a Submariner upgrade before upgrading OCP should take care of it. I am sure other projects will also have a similar requirement, upgrade them before switching OCP tp 4.14 coz older code will likely be incompatible with OCP 4.14.

Another way is to use a logic similar to here on startup to delete the flows. Like if the CIDR and priority matches but nethop does not delete the flow.

https://github.com/submariner-io/submariner/blob/devel/pkg/routeagent_driver/handlers/ovn/ovn_logical_routes.go#L78

Will this be still needed if we require submariner upgrade before OCP?

Copy link
Contributor

Choose a reason for hiding this comment

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

needed if we require submariner upgrade before OCP?

This should solve the cleanup issue if we add the code to remove flows during netwrok plugin uninstall. However the operator needs to discover the CNI again to move from non-IC to IC. Currently, we do not support on-the-fly change from non-ic mode to IC mode.

@aswinsuryan aswinsuryan dismissed their stale review August 24, 2023 14:59

Needs to handle route delete too.

@vthapar
Copy link
Contributor Author

vthapar commented Aug 25, 2023

@aswinsuryan Delete ip routes or logicalrouteer policies?

@aswinsuryan
Copy link
Contributor

@aswinsuryan Delete ip routes or logicalrouteer policies?

Logical router policies and static routes in Ovn cluster router I mean

When a submariner installation upgrades from legacy non-OVN-IC version to
an OVN-IC version, cleanup resources created by legacy installation.

Fixes submariner-io/enhancements#193

Signed-off-by: Vishal Thapar <[email protected]>
@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Aug 30, 2023
@skitt skitt enabled auto-merge (rebase) August 30, 2023 13:27
@vthapar
Copy link
Contributor Author

vthapar commented Aug 30, 2023

@aswinsuryan OVN tests failing. Failed to deploy kind with OVN.

2023-08-30T13:53:59.2282190Z �[36m[13:53:59.227] [dir=submariner]$ exit_error Failed to create clusters using 'kind'.�[0m
2023-08-30T13:53:59.2294776Z ERROR: Failed to create clusters using 'kind'.
2023-08-30T13:53:59.2321587Z �[36m[13:53:59.231] [dir=submariner; fn=exit_error]$ exit 1�[0m
2023-08-30T13:53:59.2346922Z make[1]: *** [/opt/shipyard/Makefile.inc:188: clusters] Error 1
2023-08-30T13:53:59.2347631Z make[1]: Leaving directory '/go/src/github.com/submariner-io/submariner'

@aswinsuryan
Copy link
Contributor

@aswinsuryan OVN tests failing. Failed to deploy kind with OVN.

2023-08-30T13:53:59.2282190Z �[36m[13:53:59.227] [dir=submariner]$ exit_error Failed to create clusters using 'kind'.�[0m
2023-08-30T13:53:59.2294776Z ERROR: Failed to create clusters using 'kind'.
2023-08-30T13:53:59.2321587Z �[36m[13:53:59.231] [dir=submariner; fn=exit_error]$ exit 1�[0m
2023-08-30T13:53:59.2346922Z make[1]: *** [/opt/shipyard/Makefile.inc:188: clusters] Error 1
2023-08-30T13:53:59.2347631Z make[1]: Leaving directory '/go/src/github.com/submariner-io/submariner'

This should fix it

submariner-io/shipyard#1351

@skitt skitt merged commit a2fe53d into submariner-io:devel Aug 30, 2023
39 checks passed
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr2656/vthapar/ovn-ic-upgrades]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-test When a PR is ready for full E2E testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support upgrades to the new OVN IC implementation
6 participants