The OpenShiftSDN CNI (Container Network Interface) plug-in has been deprecated since OpenShift Container Platform 4.14 and was removed in version 4.17. If your current clusters utilize OpenShiftSDN, you won’t be able to upgrade them to version 4.17 without first migrating to OVNKubernetes. If you are considering migrating from OpenShiftSDN to OVNKubernetes, this blog post is intended for you.
This blog entry is based on the OpenShift documentation section Migrating from the OpenShift SDN network plugin. This documentation section describes two migration methods for transitioning from OpenShiftSDN to OVNKubernetes: the offline migration method and the limited live migration method.
The offline migration method leads to interruptions in pod network connectivity and should only be employed when the limited live migration method is not applicable. Certain less frequent situations in which the limited live migration method cannot be utilized are mentioned in the aforementioned documentation.
The limited live migration method is the favored method for migration since it doesn’t disrupt the network connectivity of the pods. Throughout the live migration process, the connection of the pods to external networks, as well as the connectivity between the pods within the cluster, will function normally. This is accomplished by migrating the CNI of each node individually and utilizing the hybrid overlay feature of OVNKubernetes to maintain a continuous connection between the networks of the two CNI network plugins, ensuring that pods in each network can still communicate with pods in the other network.
This is particularly important if you wish to avoid the risk of workloads misbehaving after a loss of network connectivity or failing to recover once the network connectivity is restored. During the limited live migration, the pods will maintain their access to the network and connectivity with other pods within the cluster. They will merely be restarted on different nodes during the node drain process.
Note that during the network live migration, the cluster nodes are drained and rebooted two times by the machine config operator. As a result, the migration process takes approximately twice as long as a standard cluster upgrade. The initial reboot is required to reduce the MTU of network interfaces. The MTU is decreased by 50 bytes to accommodate the increased overhead associated with the OVNKubernetes overlay when compared to the OpenShiftSDN. The subsequent reboot is required to apply the modifications made to the node start-up scripts, thereby transforming it into an OVNKubernetes node.
The limited live migration has been available since OpenShift version 4.16. If you are currently operating on an earlier version of OpenShift, it is advisable to upgrade to OCP 4.16 first in order to enable the use of the limited live migration method. Ultimately, an upgrade to OCP 4.16 will be necessary regardless.
The rest of this blog post will concentrate on the process of migrating the cluster network through the use of limited live migration.
Pre-flight checks
The OpenShift documentation includes a set of considerations that you ought to examine prior to utilizing the limited live migration. In view of these considerations, this section will perform cluster checks that focus on the common scenarios. The knowledgebase article 7057169 Limited Live Migration from OpenShift SDN to OVN-Kubernetes, contains a more comprehensive list of checks.
Checking network isolation mode of OpenShiftSDN
OpenShiftSDN supports three isolation modes: network policy, multitenant, and subnet mode. The default network isolation mode in OpenShift 4 is network policy. To check the configured isolation mode, type the command:
|
|
|
|
The example above indicates that the isolation mode is set to NetworkPolicy
. If the mode setting is not present in the output, the default network policy mode is applied. The limited live migration doesn’t support clusters with OpenShiftSDN multitenant mode enabled. If your output indicates that the mode is set to Multitenant
, then live migration cannot be performed, and you will need to resort to offline migration instead.
Checking IP subnet ranges
By default, OVN-Kubernetes allocates the following ranges of IP addresses:
100.64.0.0/16
. This IP address range is used for theinternalJoinSubnet
parameter of OVN-Kubernetes.100.88.0.0/16
. This IP address range is used for theinternalTransSwitchSubnet
parameter of OVN-Kubernetes.
If these IP addresses have been used by OpenShiftSDN or any external network requiring communication with this cluster, you must patch them to use a different IP address range prior to commencing the limited live migration. Refer to the OpenShift documentation section Patching OVN-Kubernetes address ranges.
Checking cluster MTU value
Issue the following command to check the MTU setting:
|
|
|
|
The MTU can be customized by setting the spec.defaultNetwork.openshiftSDNConfig.mtu
field. In the above configuration example, this field is not included which means that we are using the default MTU and not a custom MTU. For the default MTU, no further action is required. To configure a custom MTU for OVNKubernetes, refer to the OpenShift
documentation.
Issue the following command to verify the effective MTU value:
|
|
|
|
In the output presented above, the MTU value for the cluster is 8950
(this can be found in the status.clusterNetworkMTU
field).
Checking egress IP addresses
During the migration, existing egress IP addresses will be temporarily disabled and the OpenShiftSDN egress IP configuration will be automatically converted to the respective OVNKubernetes egress IP configuration. You can verify the resulting configuration after the migration is complete.
Check if there are any egress IPs configured on the cluster:
|
|
If the output is empty like this then there are no egress IPs to convert:
|
|
Checking egress firewall
The migration process automatically converts the
OpenShiftSDN egress firewall configuration to the
OVNKubernetes egress firewall configuration, i.e. a new EgressFirewall
resource will be created for each EgressNetworkPolicy
resource in the cluster. The firewall remains functional throughout the whole migration. You can review the resulting OVNKubernetes egress firewall configuration after the migration is complete.
Check if any EgressNetworkPolicy
resources exist in the cluster:
|
|
If the output of the above command is empty like this then there are no egress firewall rules to convert:
|
|
Checking multicast namespaces
During the migration, multicast will be temporarily disabled. The migration process will automatically convert the
OpenShiftSDN multicast configuration to the
OVNKubernetes multicast configuration by annotating any multicast-enabled namespace with k8s.ovn.org/multicast-enabled=true
.
To locate namespaces with OpenShiftSDN multicast enabled, enter the following command:
|
|
If the output of the above command is empty, then there are no multicast-enabled namespaces in the cluster and nothing to worry about for the migration.
Checking egress router pods
Check if there are any egress router pods on the cluster:
|
|
If there are any egress router pods on the cluster, they must be removed prior to initiating the limited live migration process; otherwise, the process will be blocked. During the migration, the egress router pods won’t be available. You will have to re-create the OpenShiftSDN egress router pods in OVNKubernetes after the migration is complete. Note that the egress router pods in OVNKubernetes support redirect mode only. The HTTP proxy mode and DNS proxy mode, which are available in OpenShiftSDN, and not supported in OVNKubernetes.
Limited live migration procedure
Having completed the pre-flight checks, we are now prepared to migrate a cluster to OVNKubernetes. This section serves as a detailed guide through the migration process. We will begin by creating a backup of the Etcd database.
Creating backup of etcd database
The following steps are derived from the documentation section Backing up etcd data.
Start a debug session as root for a control plane node, for example:
|
|
Change your root directory to /host
in the debug shell:
|
|
Run the cluster-backup.sh
script in the debug shell and pass in the location to save the backup to:
|
|
Verify that the backup was created successfully. You should see that two files were created in the target directory:
|
|
Creating backup of cluster network configuration
Back up the configuration of the cluster network, enter the following command:
|
|
Enabling routing via host (optional)
By default, OVNKubernetes does not pass the network traffic through the host network stack when sending out traffic. Instead, egress traffic is always sent directly through the host interface connected to the br-ex
bridge. If your cluster node comes with secondary network interfaces that are necessary for accessing specific network destinations, you will need to enable the routingViaHost
setting and set ipForwarding
to Global
within the OVNKubernetes configuration. Additional details can be found in the knowledgebase article
6962558 OVN-Kubernetes ignores host routes for outgoing traffic.
To configure routing via host, issue the following command:
|
|
|
|
Executing migration from OpenShiftSDN to OVNKubernetes
Verify that all cluster operators are available, NOT progressing, and NOT degraded:
|
|
In a separate console, you can follow the network operator logs throughout the update:
|
|
To initiate the migration from OpenShift SDN to OVN-Kubernetes, enter the following command:
|
|
After issuing the above command, the migration process begins. During this process, the machine config operator reboots the nodes in your cluster two times. The above patch command triggers a roll-out of the OVNKubernetes control plane in the openshift-ovn-kubernetes
namespace:
|
|
|
|
The machine config operator will apply new machine configs to all the nodes in the cluster in preparation for the OVN-Kubernetes deployment on the nodes.
Confirm the status of the new machine configuration on the hosts. To list the machine configuration state and the name of the applied machine configuration, enter the following command:
|
|
Example output:
|
|
Verify that the following statements are true:
- The value of
machineconfiguration.openshift.io/state
field isDone
. - The value of the
machineconfiguration.openshift.io/currentConfig
field is equal to the value of themachineconfiguration.openshift.io/desiredConfig
field.
To confirm that the machine config is correct, enter the following command, where <config_name>
is the name of the machine config from the machineconfiguration.openshift.io/currentConfig
field:
|
|
The machine config should include the following update to the systemd configuration:
|
|
Check that the reboot is finished by running the following command:
|
|
Example output:
|
|
In the above output, check that the column values are UPDATED=True, UPDATING=False, DEGRADED=False.
Verify that the Multus daemon set rollout is complete before continuing with subsequent steps:
|
|
Expected output:
|
|
To confirm that the network plugin is OVN-Kubernetes, enter the following command:
|
|
Expected output:
|
|
Check the network configuration status conditions:
|
|
The conditions should indicate that the migration is complete like this:
|
|
In the above output, verify the cluster network MTU. The MTU value should be 8900 (50 bytes less than in the OpenShiftSDN status listed previously):
|
|
Confirm that the cluster nodes are in the Ready state, enter the following command:
|
|
|
|
Confirm that all pods are either running or complete:
|
|
Verify that all cluster operators are available, NOT progressing, and NOT degraded:
|
|
Cleaning up after migration completed
After a successful migration, you can remove the migration configuration from the CNO object using the following command:
|
|
|
|
Remove custom configuration of the OpenShift SDN network provider using the following command:
|
|
|
|
Remove the OpenShift SDN control plane namespace. Enter the following command:
|
|
|
|
Removing backup of the etcd database
Start a debug session as root for a control plane node, for example:
|
|
Change your root directory to /host
in the debug shell:
|
|
Remove the etcd backup:
|
|
Modifications to node network during migration process
During the migration process, the OVS configuration within the cluster undergoes multiple modifications. This section emphasizes some of the alterations you may notice on the nodes.
During the migration, the OpenShiftSDN bridge br0
is removed and the bridges br-int
, br-ex
, and br-ext
appear on the node. You can examine the bridges by issuing the following command on the cluster node:
|
|
|
|
The br-ext
bridge is a hybrid overlay bridge that ensures connectivity between the OpenShiftSDN and OVNKubernetes networks. Subsequently, during the migration process, this br-ext
bridge is removed:
|
|
|
|
Conclusion
In this blog we discussed the migration of the cluster network from OpenShiftSDN to OVNKubernetes. We started by outlining the limited live migration method from a high-level perspective. This method allows for the conversion of the existing cluster to OVNKubernetes without interrupting the workloads that are currently running on the cluster. However, there are some important considerations to keep in mind. Specifically, egress IP addresses and multicast communication are temporarily disabled during the migration. Additionally, the migration process does not accommodate the migration of egress router pods. These pods must be removed by the administrator and recreated once the migration is finalized. Subsequently, we detailed the limited live migration process itself, including example commands to monitor the progress of the migration. In conclusion, we examined some of the modifications made to the cluster node throughout the migration process.
I hope you found the OpenShift network migration process outlined in this blog to be informative. Should you have any questions or comments, please feel free to leave them in the comment section below. I look forward to receiving your feedback!