Move your ANY OpenShift or Kubernetes based applications to IBM IKS Cloud
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 k8s versions. RackWare SWIFT also lets you choose the storage of your choice for the application replication.
RackWare SWIFT now offers replicating any OpenShift or Kubernetes based application to IBM IKS cloud and IBM OpenShift IKS cloud.
Let's Get Started:
In this article, we will migrate WordPress – a blogging website hosted on Azure Kubernetes cluster (AKS) to IBM VPC Kubernetes cluster (IKS).
Replicating the application will involve the following steps:
Install the SWIFT and prerequisite steps
Add both clusters to SWIFT
Start the replication
Prepare for replication:
a) 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.
A 64-bit Centos/RedHat 7.x/8.x x86 host/CentOS stream
Minimum 8GB free space
8GB or more RAM
Two or more (V)CPUs
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.
1.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.
b) 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.
2.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.
3.Add source and target clusters to the SWIFT:
The first step before we start the replication is adding both the clusters the SWIFT. Adding the cluster to SWIFT will configure access to the clusters and SWIFT will gather the metadata of the clusters needed for the replication.
After logging into SWIFT, the first page you will see is the ‘Container Clusters.’ To add cluster to the SWIFT, select the ‘Add’ button.
Add the source Azure Kubernetes cluster:
Below is the AKS cluster running k8s version 1.21.9 and hosts the WordPress blogging application. We will use this cluster as a source for the blog use case.
Let us add this cluster to the SWIFT by entering the Azure cloud credentials like below and click on the ‘Add’ button.
Add the target IBM Kubernetes cluster to SWIFT:
Below is the IKS cluster running k8s version 1.22.7_1541. This is the cluster where we will replicate the WordPress application.
Let us add the cluster using similar steps. The only difference here is that you will have to select ’IBM cloud’ as Cloud Type 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:
4. 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:
1.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.
2.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:
a.Stage1 Sync: This will create a backup of the source application on the SWIFT including the application objects and the data.
b.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 ‘azure-k8s-cluster' 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-vpc-k8s-cluster' 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 K8S/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 two PersistentVolumeClaims are a part of the WordPress 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 WordPress application on the IBM VPC Cluster:
Since the replication is now complete, let us check the IBM VPC cluster dashboard to access the newly replicated application. We can see that the workloads are healthy and in a running state.
Let us go to the service section to access the application and click on the first ’External Endpoint’ of the WordPress service.
The application is now live!
For more information, check out the SWIFT’s details here .
Contact us here or email us at [email protected].