- There are three modes for synchronization or replication in SWIFT: Passthrough, Stage1, and Stage2.
- SWIFT supports synchronization between Kubernetes clusters, Kubernetes to OpenShift, OpenShift to OpenShift, and OpenShift to Kubernetes, enabling cross-cloud as well as cross-platform/version compatibility.
- SWIFT also supports registry replication with compatible image registries.
Sync between Kubernetes clusters (Passthrough mode).
- First, we need to login to the SWIFT dashboard and navigate to the ‘All Replication’ under ‘Sync administration’ menu and click on ‘New’ button and select ‘Application Replication’. Please find snippet below.
- When you click on Application Replication, you will see three modes of replication. Please refer to the snippet below for reference.
- In the above snippet, we have selected Passthrough Sync mode for synchronization or replication.
- Passthrough Sync: We refer to this as PT Sync, which is a lift-and-shift replication. It replicates the application directly from the source Kubernetes cluster to the target Kubernetes cluster without requiring any additional storage.
- In both the source and target blocks, you need to select the platform type as Kubernetes.
- Cluster Name: You can select the discovered clusters from the dropdown menu, then choose which one will be the source and which one will be the target.
- Namespace: You need to select the namespace you are going to migrate on the target from the drop-down menu on both sides.
- Applications (Source cluster): There are three options in application.
- All: If you want to migrate everything from your namespace to the target, you can select the "All" option.
- Selective: If you select this option, the selective application block will automatically become active. You will need to select the object type from the dropdown menu. Once you select any object, SWIFT will intelligently identify their dependencies and migrate those as well. Please see below snippet for reference.
- Include K8S native object: If you select this option, SWIFT will also migrate services and objects created natively in the Kubernetes control plane.
- Sync Webhooks: In sync webhook there are 3 options as you can see on above screenshot.
- All:- If you want to sync all webhook, like in case you having service mesh that needs all the webhook, in that case you need to select all.
- Native Webhooks: - If you want to sync native webhooks, then you can select this option.
- Don’t delete taints: - By-default during sync taints is going to be deleted, if you don’t want to delete, then you can select this option under sync webhook option.
- In the General options, under Target, you need to select the target cluster. In this case, we have selected the GKE cluster. You will also need to select the namespace from which you want to migrate the app.
- SWIFT intelligently identifies the target storage class based on your cloud provider, and you will need to choose from the available options.
- When selecting GKE, you also need to specify the zone. Depending on the cloud provider, make sure to provide the appropriate details.
- There will be a one option ‘Delete target namespace-only object’ , if you select this option it will delete the objects from the target namespace that no more exists in the source cluster namespace.
- In the ‘Custom resources configuration’ you must choose customer resource if it is cluster scope or namespace scope.
- Exclude Application for Replication: If you want to exclude any object, such as a Deployment, ReplicaSet, etc., during sync, you can select the object from the 'Object Type' option. Once you select an object, SWIFT will also identify its dependencies and exclude those as well.
- In TRAIPOD Options:
- In this section, for transient pods, you can select different IP types such as LoadBalancer, NodePort, or ClusterIP. The choice depends on the type of connection between the source and target Kubernetes environments. Based on that, you can select the appropriate IP type
- There are two groups used by the transient pod, which will be deployed on both the source and target environments. During synchronization, when you select 'Auto Select Port,' it will open a port on both the production and target environments, which will be used for transferring the data.
- There is also an 'Advanced' option, which you can use during synchronization. Please refer a KB article to Advanced options.
Sync between Kubernetes clusters (Stage-1 mode).
- After clicking on Stage-1, you will see the interface below. It is quite different from Passthrough mode. In Stage-1 sync, the source data will be stored on the SWIFT side in a storage pool. Please refer to the snippet.
- If you look at the target, there will be a storage pool option. You need to create a storage pool under the 'Business Continuity and DR' section, where the storage pool configuration option is available. Please refer to the Storage Pool Creation KB article for more details.
- You just put the storage pool name and Image group name.
- At the source, nothing will change, just like in Passthrough mode.
- In this sync there will be a additional option i.e. ‘Backup Option’ , in this section there is a two options.
- Local Backup: Suppose you want another backup; backup will be stored in SWIFT side. You must put the backup name.
- Remote Backup: It means, you can store on any cloud, you have to specify backup intel that you want to backup to store in object storage.
- For the remote backup, you must create a remote backup in the Storage Pool Creation tab. Please refer to the KB article for more information on creating a storage pool.
Sync between Kubernetes clusters (Stage-2 mode).
- In the stage-2 sync, it will sync from your SWIFT to Target cluster.
- In this mode you sync between image group and objects from stage1 sync to target cluster.
- If you look at in below snippet, you will see a Source as a Image group and Target will be a Target cluster.
- You just need to select the Storage Pool and Image Group on the source side. On the target side, you must select the target cluster, namespace, and storage class, along with all details such as the transient pod options and configuration. Then, all your data will be transferred to the target cluster.
- In this mode, you can sync between SWIFT image group and objects from stage1 to target cluster. Remaining input would be the same as stage1 at target side.
Sync between OpenShift clusters.