Alternate installations for the Migration Toolkit for Containers

Updated

The Migration Toolkit for Containers (MTC) migrates application workloads from one Red Hat OpenShift Container Platform (RHOCP) cluster to another. The This content is not included.standard MTC installation installs the MTC on the 4.x target cluster.

This article describes alternate installation use cases:

  • Installing the MTC, with the web console and Migration Controller, on a 3.x cluster.

    You can install the MTC web console and Migration Controller on a 3.x cluster to support the following use cases:

    • Migrating from a 3.x source cluster to 3.x target cluster

    • Migrating from a 3.x to 4.x, with the MTC installed on the 3.x source cluster

      Note Installing the MTC web console and Migration Controller on the source cluster is recommended only for migrating from an on-premises source cluster to a cloud-based target cluster.

  • Installing the MTC, with the web console and Migration Controller, on a 4.x remote cluster.

    You can install the MTC web console and Migration Controller on a cluster that is neither a source nor a target cluster.

Installing the MTC, with the web console and Migration Controller, on a 3.x cluster

This procedure installs the MTC web console and Migration Controller on the 3.x cluster.

Prerequisites

  • You must have podman installed.

  • Your 3.x cluster must be configured to pull images from registry.redhat.io.

    To pull images, you must create an imagestreamsecret and copy it to each node in your cluster.

Procedure

  1. Log in to registry.redhat.io with your Red Hat Customer Portal credentials:
$ sudo podman login registry.redhat.io

If your system is configured for rootless Podman containers, sudo is not required for this procedure.

  1. Download the operator.yml file:
$ sudo podman cp $(sudo podman create registry.redhat.io/rhmtc/openshift-migration-rhel7-operator:v1.3.0):/operator.yml ./
  1. Download the controller-3.yml file:
$ sudo podman cp $(sudo podman create registry.redhat.io/rhmtc/openshift-migration-rhel7-operator:v1.3.0):/controller-3.yml ./
  1. Update the controller-3.yml file:
spec:
  ...
  migration_controller: true
  migration_ui: true
  ...
  mig_ui_cluster_api_endpoint: (1)

(1) Specify the 3.x cluster's API endpoint, for example, https://www.openshift_cluster.com:8443.

If the API endpoint is not added at the same time as the migration_controller and migration_ui settings, you must restart the migration_ui pod manually to update the settings.

  1. Log in to your 3.x cluster.

  2. Verify that the cluster can authenticate with registry.redhat.io:

$ oc run test --image registry.redhat.io/ubi8 --command sleep infinity
  1. Create the MTC Operator:
$ oc create -f operator.yml
namespace/openshift-migration created
rolebinding.rbac.authorization.k8s.io/system:deployers created
serviceaccount/migration-operator created
customresourcedefinition.apiextensions.k8s.io/migrationcontrollers.migration.openshift.io created
role.rbac.authorization.k8s.io/migration-operator created
rolebinding.rbac.authorization.k8s.io/migration-operator created
clusterrolebinding.rbac.authorization.k8s.io/migration-operator created
deployment.apps/migration-operator created
Error from server (AlreadyExists): error when creating "./operator.yml":
rolebindings.rbac.authorization.k8s.io "system:image-builders" already exists
Error from server (AlreadyExists): error when creating "./operator.yml":
rolebindings.rbac.authorization.k8s.io "system:image-pullers" already exists

You can ignore the Error from server (AlreadyExists) messages. They are caused by the Cluster Application Migration Operator creating resources for earlier versions of 3.x that are provided in later releases.

  1. Create the Migration Controller:
$ oc create -f controller-3.yml
  1. Verify that the Velero and Restic pods are running:
$ oc get pods -n openshift-migration

Configuring cross-origin resource sharing

You must configure cross-origin resource sharing on a 3.x cluster so that the MTC can communicate with the API servers of the other cluster nodes.

Procedure

  1. Log in to the 3.x cluster where you installed the MTC.
  2. Obtain the MTC URL:
$ oc get -n openshift-migration route/migration -o go-template='https://{{ .spec.host }}'

The output resembles the following: https://migration-openshift-migration.apps.cluster.openshift.com.

  1. Add the MTC URL to the /etc/origin/master/master-config.yaml file of each master node under corsAllowedOrigins as in the following example:
corsAllowedOrigins:
- (?i)https://migration-openshift-migration\.apps\.cluster\.openshift\.com(:|\z)
  1. Restart the API server and controllers to apply the changes:
  • For RHOCP 3.9:

    $ systemctl restart atomic-openshift-master-api
    $ systemctl restart atomic-openshift-master-controllers
    
  • For RHOCP 3.10 and 3.11:

    $ /usr/local/bin/master-restart api
    $ /usr/local/bin/master-restart controllers
    

Installing the MTC, with the web console and the Migration Controller, on a 4.x remote cluster

Follow the procedure for installing the MTC on a This page is not included, but the link has been rewritten to point to the nearest parent document.4.x target cluster.

This installation installs the MTC with the web console and the Migration Controller. No changes are required.

After you have installed the MTC, with the web console and the Migration Controller, on the 4.x remote cluster, you must install MTC, without the web console and the Migration Controller, on the source and target clusters.

Installing the MTC, without the web console or Migration Controller, on a 3.x source cluster

Follow the procedure for installing the MTC on a This page is not included, but the link has been rewritten to point to the nearest parent document.3.x source cluster.

This installation installs the MTC without the web console or the Migration Controller. No changes are required.

Installing the MTC, without the web console or Migration Controller, on a 4.x target cluster

The following procedure installs the MTC without the web console or the Migration Controller on a 4.x cluster.

Procedure

  1. In the OpenShift Container Platform web console, click *Operators > OperatorHub.

  2. Use the Filter by keyword field (in this case, MTC) to find the MTC Operator.

  3. Select the MTC Operator and click Install.

  4. On the Install Operator page, click Install.
    On the Installed Operators page, the MTC Operator appears in the openshift-migration project with the status Succeeded.

  5. Click MTC Operator.

  6. Under Provided APIs, locate the Migration Controller tile, and click *Create Instance.

  7. Click Create.

  8. Update the migration_controller and migration_ui parameters in the spec stanza:

spec:
  ...
  migration_controller: false
  migration_ui: false
  ...
  1. Click Workloads > Pods to verify that the Restic and Velero pods are running.
SBR
Category
Article Type