​Move your ANY OpenShift or Kubernetes based applications to IBM OpenShift Cloud

RedHat OpenShift on the IBM cloud provides users a fast and secure way to containerize and deploy applications. With a variety of storage available on the cloud, users can choose one that suits their needs. If you want to migrate your containerized application to the IBM OpenShift cluster, RackWare SWIFT is the solution.

RackWare SWIFT is RackWare’s migration and disaster-recovery solution for containerized workloads running on any platform including the following:

  • Oracle (OKE)

  • Azure (AKS)

  • Google (GKE)

  • AWS (EKS)

  • IBM (IKS)

  • OpenShift

It offers a quick and effortless way to move your workloads across the platforms and versions and helps you leverage the benefits of the newer OpenShift versions. RackWare SWIFT also lets you choose the storage of your choice for the application replication.

Let's Get Started:

In this article, we will migrate Jenkins – an open-source automation server application hosted on AWS OpenShift Origin (OKD) cluster to IBM OCP (OpenShift Container Platform) cluster running on VPC Gen2 Infrastructure.

Replicating the application will involve the following steps:

  • Install the SWIFT and perform a few prerequisite steps mentioned below

  • Add source and target clusters to SWIFT

  • Start the replication

Prepare for replication:

1)Install SWIFT

SWIFT can be installed on any physical server or virtual machine. Make sure you have the resources listed below to get started with the installation.

  1. A 64-bit Centos/RedHat 7.x/8.x x86 host/CentOS stream

  2. Minimum 8GB free space

  3. 8GB or more RAM

  4. Two or more (V)CPUs

  5. Internet connectivity on the host (yum needs to be working with EPEL repo enabled)

If you are planning for DR, you will need to attach storage to the machine where SWIFT is installed. Additional storage need not be available during the SWIFT installation. It can be added later.

Start the installation:

  • Log in to the host where you want to install SWIFT. Run the installer package. If you get permission denied error, add executable permissions to the package using the command below and retry: chmod +x rackware-swift-release-<version>.sh

  • During the installation, you will be asked to accept the EULA. Enter ‘yes’ to accept it and continue the installation by accepting subsequent prompts for default configs.

  • You will be asked to set the password for the admin user during the installation. If you do not set it during the installation, you can set it or change the password using the following CLI: swiftcli user modify admin –password <password>

  • Please note this password as you will need this to access the SWIFT dashboard in the next step.

  • After the installation is complete, if a reboot is needed, a prompt will be displayed asking you to confirm. It is highly recommended to accept it to ensure that all SWIFT services function correctly.

Sync Prerequisites

  • You need to create a namespace on the target cluster where you want to replicate the application to.

  • Create K8S secret on both source and target namespace for TRAI to configure access to your container registry where the TRAI image is present. TRAI (Acronym for –Transient Rackware Agent Image) is an image, which is deployed with the SWIFT product, and a user can register it under their private container registry. This image runs as a POD on the source and target K8S cluster during sync.

Log in to the SWIFT dashboard:

To access the SWIFT dashboard, enter the SWIFT URL of the format https://<swift-server-ip>/swift/dashboard in your browser. Please provide the username and password and click on the ‘LOGIN’ button.

Add source and target clusters to the SWIFT:

Adding the clusters to the SWIFT is an important and mandatory step. Under this step, SWIFT will connect to the cluster and gather the metadata required for the replication like projects, pods, etc. present on the cluster.

Add the source AWS OKD cluster:

Below is the AWS OKD cluster running version 4.8.0 and hosts the WordPress blogging application. We will use this cluster as a source for the blog use case.

To add cluster to the SWIFT, select the ‘Add’ button.

While adding the cluster, you will have to select the ’Platform Type.’ In the blog use case, since both source and target clusters are OpenShift clusters, select the ’OpenShift’ platform type in both cases.

Let us add this cluster to the SWIFT by entering the AWS cloud credentials like below and click on the ‘Add’ button.

Add the target IBM OpenShift cluster to SWIFT:

Below is the IBM OCP cluster running version 4.9.25. This is the cluster where we will replicate the WordPress application.

SWIFT supports both variants of OpenShift cluster on IBM

  • OpenShift Container Platform (OCP)

  • OpenShift Origin (OKD)

Let us add the IBM OCP cluster using similar steps we executed before. The only difference here is that you will have to select ’IBM OpenShift-Container Platform’ as Cloud Type here and enter the IBM cloud credentials.

After the clusters are added, you can see the basic details of the clusters on the same page. See the screenshot below:

To get more details like k8s objects present on the cluster, you can expand the cluster view.

Start the replication:

  • Navigate to the sidebar menu and select the ‘Sync Administration’ option. You will see two sub-menu options there. Now select the ‘All Replication’ option. You will see a ‘New’ button on the top of the page. SWIFT supports replication of containerized applications as well as container registries. For the context of this article, select the new button and click on the ‘Application Replication’ option.

On selecting the ‘Application Replication’ option, a popup window will open. You will see the following sync types:

Passthrough Sync:

  • Use this mode for migration use case.

  • This mode will replicate the application as-is from any cluster to another or intra-cluster sync without keeping a backup of the application.

Staged Sync:

  • Use this mode for DR use case.

  • This mode allows migration and DR by keeping a backup of the application on the SWIFT host’s local storage.

It is a two-step sync mode:

  • Stage1 Sync: This will create a backup of the source application on the SWIFT including the application objects and the data.

  • Stage2 Sync: This will allow replicating the backup to the target cluster or namespace where you want to migrate the application.

For the article use case of migration, let us select the ‘Passthrough’ sync type.

Provide source details:

Select ‘aws-openshift-source’ as a source cluster and select the ‘wordpress’ namespace where your application is deployed. SWIFT allows replicating all or selected applications. Let us select ‘All’ for now.

Provide target details:

Select ‘ibm-openshift-target as a target cluster and select ‘wordpress’ namespace which should be created before starting the replication process. Then, select the preferred storage class for your application. If your IBM cluster nodes are available across multiple zones, you will be asked to select the zone where the application’s storage volumes will be provisioned.

  • Provide the TRAI image name and secret details in the sync window. Also, provide the TRAI ports input from the cluster’s service port range. If not provided, these will be auto picked.

  • After all the necessary details are filled, click on the ‘Add’ button to start the replication.

  • During the replication, SWIFT will identify all the OpenShift objects associated with the selected application and will create all of them on the target. In the screenshot below, we can see that sync has identified that one PersistentVolumeClaim is a part of the Jenkins application.

  • After the replication is complete, a notification will be displayed, and the user can see the operation details by expanding the replication job.

  • Accessing the replicated Jenkins application on the IBM VPC Cluster:

Since the replication is now complete, let us check the IBM OpenShift cluster’s console to access the newly replicated application. We can see that the workload is healthy and in a running state.

Let us go to the service section, select the ‘mt-jenkins.’ Copy the ‘Location’ of the external load balancer and paste it on the browser to access the application.

The application is now live!

For more information, check out the SWIFT’s details here

Contact us here or email us at [email protected].  

>