Skip to content

Commit b508731

Browse files
authored
Merge pull request #56592 from jboxman-rh/OSDOCS-4933
OSDOCS-4933: Add migration to OpenShift SDN
2 parents b24250e + 7905b8d commit b508731

File tree

8 files changed

+204
-82
lines changed

8 files changed

+204
-82
lines changed

_topic_maps/_topic_map.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,10 @@ Topics:
12981298
Topics:
12991299
- Name: About the OpenShift SDN network plugin
13001300
File: about-openshift-sdn
1301+
- Name: Migrating to the OpenShift SDN network plugin
1302+
File: migrate-to-openshift-sdn
1303+
- Name: Rolling back to the OpenShift SDN network plugin
1304+
File: rollback-to-ovn-kubernetes
13011305
- Name: Configuring egress IPs for a project
13021306
File: assigning-egress-ips
13031307
Distros: openshift-origin,openshift-enterprise
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc
4+
// * networking/openshift_sdn/migrate-to-openshift-sdn.adoc
5+
6+
ifeval::["{context}" == "migrate-to-openshift-sdn"]
7+
:sdn: OpenShift SDN
8+
:previous-sdn: OVN-Kubernetes
9+
:type: OpenShiftSDN
10+
endif::[]
11+
ifeval::["{context}" == "migrate-from-openshift-sdn"]
12+
:sdn: OVN-Kubernetes
13+
:previous-sdn: OpenShift SDN
14+
:type: OVNKubernetes
15+
endif::[]
16+
17+
[id="how-the-migration-process-works_{context}"]
18+
= How the migration process works
19+
20+
The following table summarizes the migration process by segmenting between the user-initiated steps in the process and the actions that the migration performs in response.
21+
22+
.Migrating to {sdn} from {previous-sdn}
23+
[cols="1,1a",options="header"]
24+
|===
25+
26+
|User-initiated steps|Migration activity
27+
28+
|
29+
Set the `migration` field of the `Network.operator.openshift.io` custom resource (CR) named `cluster` to `{type}`. Make sure the `migration` field is `null` before setting it to a value.
30+
|
31+
Cluster Network Operator (CNO):: Updates the status of the `Network.config.openshift.io` CR named `cluster` accordingly.
32+
Machine Config Operator (MCO):: Rolls out an update to the systemd configuration necessary for {sdn}; the MCO updates a single machine per pool at a time by default, causing the total time the migration takes to increase with the size of the cluster.
33+
34+
|Update the `networkType` field of the `Network.config.openshift.io` CR.
35+
|
36+
CNO:: Performs the following actions:
37+
+
38+
--
39+
* Destroys the {previous-sdn} control plane pods.
40+
* Deploys the {sdn} control plane pods.
41+
* Updates the Multus objects to reflect the new network plugin.
42+
--
43+
44+
|
45+
Reboot each node in the cluster.
46+
|
47+
Cluster:: As nodes reboot, the cluster assigns IP addresses to pods on the {sdn} cluster network.
48+
49+
|===
50+
51+
ifeval::["{context}" == "migrate-from-openshift-sdn"]
52+
If a rollback to OpenShift SDN is required, the following table describes the process.
53+
54+
.Performing a rollback to OpenShift SDN
55+
[cols="1,1a",options="header"]
56+
|===
57+
58+
|User-initiated steps|Migration activity
59+
60+
|Suspend the MCO to ensure that it does not interrupt the migration.
61+
|The MCO stops.
62+
63+
|
64+
Set the `migration` field of the `Network.operator.openshift.io` custom resource (CR) named `cluster` to `OpenShiftSDN`. Make sure the `migration` field is `null` before setting it to a value.
65+
|
66+
CNO:: Updates the status of the `Network.config.openshift.io` CR named `cluster` accordingly.
67+
68+
|Update the `networkType` field.
69+
|
70+
CNO:: Performs the following actions:
71+
+
72+
--
73+
* Destroys the OVN-Kubernetes control plane pods.
74+
* Deploys the OpenShift SDN control plane pods.
75+
* Updates the Multus objects to reflect the new network plugin.
76+
--
77+
78+
|
79+
Reboot each node in the cluster.
80+
|
81+
Cluster:: As nodes reboot, the cluster assigns IP addresses to pods on the OpenShift-SDN network.
82+
83+
|
84+
Enable the MCO after all nodes in the cluster reboot.
85+
|
86+
MCO:: Rolls out an update to the systemd configuration necessary for OpenShift SDN; the MCO updates a single machine per pool at a time by default, so the total time the migration takes increases with the size of the cluster.
87+
88+
|===
89+
endif::[]
90+
91+
ifdef::sdn[]
92+
:!sdn:
93+
endif::[]
94+
ifdef::previous-sdn[]
95+
:!previous-sdn:
96+
endif::[]
97+
ifdef::type[]
98+
:!type:
99+
endif::[]

modules/nw-ovn-kubernetes-migration-about.adoc

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -138,75 +138,3 @@ For more information on using multicast in OVN-Kubernetes, see "Enabling multica
138138
=== Network policies
139139

140140
OVN-Kubernetes fully supports the Kubernetes `NetworkPolicy` API in the `networking.k8s.io/v1` API group. No changes are necessary in your network policies when migrating from OpenShift SDN.
141-
142-
[id="how-the-migration-process-works_{context}"]
143-
== How the migration process works
144-
145-
The following table summarizes the migration process by segmenting between the user-initiated steps in the process and the actions that the migration performs in response.
146-
147-
.Migrating to OVN-Kubernetes from OpenShift SDN
148-
[cols="1,1a",options="header"]
149-
|===
150-
151-
|User-initiated steps|Migration activity
152-
153-
|
154-
Set the `migration` field of the `Network.operator.openshift.io` custom resource (CR) named `cluster` to `OVNKubernetes`. Make sure the `migration` field is `null` before setting it to a value.
155-
|
156-
Cluster Network Operator (CNO):: Updates the status of the `Network.config.openshift.io` CR named `cluster` accordingly.
157-
Machine Config Operator (MCO):: Rolls out an update to the systemd configuration necessary for OVN-Kubernetes; The MCO updates a single machine per pool at a time by default, causing the total time the migration takes to increase with the size of the cluster.
158-
159-
|Update the `networkType` field of the `Network.config.openshift.io` CR.
160-
|
161-
CNO:: Performs the following actions:
162-
+
163-
--
164-
* Destroys the OpenShift SDN control plane pods.
165-
* Deploys the OVN-Kubernetes control plane pods.
166-
* Updates the Multus objects to reflect the new network plugin.
167-
--
168-
169-
|
170-
Reboot each node in the cluster.
171-
|
172-
Cluster:: As nodes reboot, the cluster assigns IP addresses to pods on the OVN-Kubernetes cluster network.
173-
174-
|===
175-
176-
If a rollback to OpenShift SDN is required, the following table describes the process.
177-
178-
.Performing a rollback to OpenShift SDN
179-
[cols="1,1a",options="header"]
180-
|===
181-
182-
|User-initiated steps|Migration activity
183-
184-
|Suspend the MCO to ensure that it does not interrupt the migration.
185-
|The MCO stops.
186-
187-
|
188-
Set the `migration` field of the `Network.operator.openshift.io` custom resource (CR) named `cluster` to `OpenShiftSDN`. Make sure the `migration` field is `null` before setting it to a value.
189-
|
190-
CNO:: Updates the status of the `Network.config.openshift.io` CR named `cluster` accordingly.
191-
192-
|Update the `networkType` field.
193-
|
194-
CNO:: Performs the following actions:
195-
+
196-
--
197-
* Destroys the OVN-Kubernetes control plane pods.
198-
* Deploys the OpenShift SDN control plane pods.
199-
* Updates the Multus objects to reflect the new network plugin.
200-
--
201-
202-
|
203-
Reboot each node in the cluster.
204-
|
205-
Cluster:: As nodes reboot, the cluster assigns IP addresses to pods on the OpenShift-SDN network.
206-
207-
|
208-
Enable the MCO after all nodes in the cluster reboot.
209-
|
210-
MCO:: Rolls out an update to the systemd configuration necessary for OpenShift SDN; The MCO updates a single machine per pool at a time by default, so the total time the migration takes increases with the size of the cluster.
211-
212-
|===

modules/nw-ovn-kubernetes-migration.adoc

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Module included in the following assemblies:
22
//
33
// * networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc
4+
// * networking/openshift_sdn/rollback-to-ovn-kubernetes.adoc
45

56
:_content-type: PROCEDURE
67
[id="nw-ovn-kubernetes-migration_{context}"]
@@ -277,7 +278,26 @@ Waiting for daemon set "multus" rollout to finish: 5 of 6 updated pods are avail
277278
daemon set "multus" successfully rolled out
278279
----
279280

280-
. To complete the migration, reboot each node in your cluster. For example, you can use a bash script similar to the following example. The script assumes that you can connect to each host by using `ssh` and that you have configured `sudo` to not prompt for a password.
281+
. To complete changing the network plugin, reboot each node in your cluster. You can reboot the nodes in your cluster with either of the following approaches:
282+
283+
** With the `oc rsh` command, you can use a bash script similar to the following:
284+
+
285+
[source,bash]
286+
----
287+
#!/bin/bash
288+
readarray -t POD_NODES <<< "$(oc get pod -n openshift-machine-config-operator -o wide| grep daemon|awk '{print $1" "$7}')"
289+
290+
for i in "${POD_NODES[@]}"
291+
do
292+
read -r POD NODE <<< "$i"
293+
until oc rsh -n openshift-machine-config-operator "$POD" chroot /rootfs shutdown -r +1
294+
do
295+
echo "cannot reboot node $NODE, retry" && sleep 3
296+
done
297+
done
298+
----
299+
300+
** With the `ssh` command, you can use a bash script similar to the following. The script assumes that you have configured sudo to not prompt for a password.
281301
+
282302
[source,bash]
283303
----
@@ -289,8 +309,6 @@ do
289309
ssh -o StrictHostKeyChecking=no core@$ip sudo shutdown -r -t 3
290310
done
291311
----
292-
+
293-
If ssh access is not available, you might be able to reboot each node through the management portal for your infrastructure provider.
294312
295313
. Confirm that the migration succeeded:
296314

modules/nw-ovn-kubernetes-rollback.adoc

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
// Module included in the following assemblies:
22
//
33
// * networking/ovn_kubernetes_network_provider/rollback-to-openshift-sdn.adoc
4+
// * networking/openshift_sdn/migrate-to-openshift-sdn.adoc
45

6+
// This procedure applies to both a roll back and a migration
57
:_content-type: PROCEDURE
68
[id="nw-ovn-kubernetes-rollback_{context}"]
7-
= Rolling back the network plugin to OpenShift SDN
9+
= Migrating to the OpenShift SDN network plugin
810

9-
As a cluster administrator, you can rollback your cluster to the OpenShift SDN Container Network Interface (CNI) network plugin.
10-
During the rollback, you must reboot every node in your cluster.
11+
As a cluster administrator, you can migrate to the OpenShift SDN Container Network Interface (CNI) network plugin.
12+
During the migration you must reboot every node in your cluster.
1113

14+
ifeval::["{context}" == "rollback-to-openshift-sdn"]
1215
[IMPORTANT]
1316
====
1417
Only rollback to OpenShift SDN if the migration to OVN-Kubernetes fails.
1518
====
19+
endif::[]
1620

1721
.Prerequisites
1822

1923
* Install the OpenShift CLI (`oc`).
2024
* Access to the cluster as a user with the `cluster-admin` role.
2125
* A cluster installed on infrastructure configured with the OVN-Kubernetes network plugin.
26+
* A recent backup of the etcd database is available.
27+
* A reboot can be triggered manually for each node.
28+
* The cluster is in a known good state, without any errors.
2229
2330
.Procedure
2431

@@ -37,7 +44,15 @@ $ oc patch MachineConfigPool master --type='merge' --patch \
3744
[source,terminal]
3845
----
3946
$ oc patch MachineConfigPool worker --type='merge' --patch \
40-
'{ "spec":{ "paused" :true } }'
47+
'{ "spec":{ "paused": true } }'
48+
----
49+
50+
. To prepare for the migration, set the migration field to `null` by entering the following command:
51+
+
52+
[source,terminal]
53+
----
54+
$ oc patch Network.operator.openshift.io cluster --type='merge' \
55+
--patch '{ "spec": { "migration": null } }'
4156
----
4257

4358
. To start the migration, set the network plugin back to OpenShift SDN by entering the following commands:
@@ -142,7 +157,26 @@ Waiting for daemon set "multus" rollout to finish: 5 of 6 updated pods are avail
142157
daemon set "multus" successfully rolled out
143158
----
144159

145-
. To complete the rollback, reboot each node in your cluster. For example, you could use a bash script similar to the following. The script assumes that you can connect to each host by using `ssh` and that you have configured `sudo` to not prompt for a password.
160+
. To complete changing the network plugin, reboot each node in your cluster. You can reboot the nodes in your cluster with either of the following approaches:
161+
162+
** With the `oc rsh` command, you can use a bash script similar to the following:
163+
+
164+
[source,bash]
165+
----
166+
#!/bin/bash
167+
readarray -t POD_NODES <<< "$(oc get pod -n openshift-machine-config-operator -o wide| grep daemon|awk '{print $1" "$7}')"
168+
169+
for i in "${POD_NODES[@]}"
170+
do
171+
read -r POD NODE <<< "$i"
172+
until oc rsh -n openshift-machine-config-operator "$POD" chroot /rootfs shutdown -r +1
173+
do
174+
echo "cannot reboot node $NODE, retry" && sleep 3
175+
done
176+
done
177+
----
178+
179+
** With the `ssh` command, you can use a bash script similar to the following. The script assumes that you have configured sudo to not prompt for a password.
146180
+
147181
[source,bash]
148182
----
@@ -154,8 +188,6 @@ do
154188
ssh -o StrictHostKeyChecking=no core@$ip sudo shutdown -r -t 3
155189
done
156190
----
157-
+
158-
If ssh access is not available, you might be able to reboot each node through the management portal for your infrastructure provider.
159191
160192
. After the nodes in your cluster have rebooted, start all of the machine configuration pools:
161193
+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:_content-type: ASSEMBLY
2+
[id="migrate-to-openshift-sdn"]
3+
= Migrating to the OpenShift SDN network plugin
4+
include::_attributes/common-attributes.adoc[]
5+
:context: migrate-to-openshift-sdn
6+
7+
toc::[]
8+
9+
As a cluster administrator, you can migrate to the OpenShift SDN network plugin from the OVN-Kubernetes network plugin.
10+
11+
To learn more about OpenShift SDN, read xref:../../networking/openshift_sdn/about-openshift-sdn.adoc#about-openshift-sdn[About the OpenShift SDN network plugin].
12+
13+
include::modules/nw-network-plugin-migration-process.adoc[leveloffset=+1]
14+
include::modules/nw-ovn-kubernetes-rollback.adoc[leveloffset=+1]
15+
16+
[role="_additional-resources"]
17+
[id="migrate-to-openshift-sdn-additional-resources"]
18+
== Additional resources
19+
20+
* xref:../../networking/cluster-network-operator.adoc#nw-operator-configuration-parameters-for-openshift-sdn_cluster-network-operator[Configuration parameters for the OpenShift SDN network plugin]
21+
* xref:../../backup_and_restore/control_plane_backup_and_restore/backing-up-etcd.adoc#backup-etcd[Backing up etcd]
22+
* xref:../../networking/network_policy/about-network-policy.adoc#about-network-policy[About network policy]
23+
* OpenShift SDN capabilities
24+
- xref:../../networking/openshift_sdn/assigning-egress-ips.adoc#assigning-egress-ips[Configuring egress IPs for a project]
25+
- xref:../../networking/openshift_sdn/configuring-egress-firewall.adoc#configuring-egress-firewall[Configuring an egress firewall for a project]
26+
- xref:../../networking/openshift_sdn/enabling-multicast.adoc#enabling-multicast[Enabling multicast for a project]
27+
* xref:../../rest_api/operator_apis/network-operator-openshift-io-v1.adoc#network-operator-openshift-io-v1[Network [operator.openshift.io/v1]]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
:_content-type: ASSEMBLY
2+
[id="roll-back-to-ovn-kubernetes"]
3+
= Rolling back to the OVN-Kubernetes network plugin
4+
include::_attributes/common-attributes.adoc[]
5+
:context: roll-back-to-ovn-kubernetes
6+
7+
toc::[]
8+
9+
As a cluster administrator, you can rollback to the OVN-Kubernetes network plugin from the OpenShift SDN network plugin if the migration to OpenShift SDN is unsuccessful.
10+
11+
To learn more about OVN-Kubernetes, read xref:../../networking/ovn_kubernetes_network_provider/about-ovn-kubernetes.adoc#about-ovn-kubernetes[About the OVN-Kubernetes network plugin].
12+
13+
include::modules/nw-ovn-kubernetes-migration.adoc[leveloffset=+1]

networking/ovn_kubernetes_network_provider/migrate-from-openshift-sdn.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ As a cluster administrator, you can migrate to the OVN-Kubernetes network plugin
1111
To learn more about OVN-Kubernetes, read xref:../../networking/ovn_kubernetes_network_provider/about-ovn-kubernetes#about-ovn-kubernetes[About the OVN-Kubernetes network plugin].
1212

1313
include::modules/nw-ovn-kubernetes-migration-about.adoc[leveloffset=+1]
14+
include::modules/nw-network-plugin-migration-process.adoc[leveloffset=+2]
1415

1516
include::modules/nw-ovn-kubernetes-migration.adoc[leveloffset=+1]
1617

0 commit comments

Comments
 (0)