You can install the Migration Toolkit for Containers (MTC) on OKD 3 and 4 in a restricted network environment.

After you install the Migration Toolkit for Containers Operator on OKD 4 by using the Operator Lifecycle Manager, you manually install the legacy Migration Toolkit for Containers Operator on OKD 3.

By default, the MTC web console and the Migration Controller pod run on the target cluster. You can configure the Migration Controller custom resource manifest to run the MTC web console and the Migration Controller pod on a source cluster or on a remote cluster.

After you have installed MTC, you must configure an object storage to use as a replication repository.

Compatibility guidelines

You must install the Migration Toolkit for Containers (MTC) version that is compatible with your OKD version.

Table 1. OKD and MTC compatibility
OKD version MTC version Migration Toolkit for Containers Operator

3.7

1.5.1

Legacy Migration Toolkit for Containers Operator.

Installed manually with the operator-3.7.yml file.

3.9 to 4.5

1.5.1

Legacy Migration Toolkit for Containers Operator.

Installed manually with the operator.yml file.

4.6 and later versions

1.5.1

Migration Toolkit for Containers Operator.

Installed with the Operator Lifecycle Manager.

Installing the Migration Toolkit for Containers Operator on OKD 4

You install the Migration Toolkit for Containers Operator on OKD 4 by using the Operator Lifecycle Manager.

Prerequisites
  • You must be logged in as a user with cluster-admin privileges on all clusters.

  • You must create an Operator catalog from a mirror image in a local registry.

Procedure
  1. In the OKD web console, click OperatorsOperatorHub.

  2. Use the Filter by keyword field to find the Migration Toolkit for Containers Operator.

  3. Select the Migration Toolkit for Containers Operator and click Install.

  4. Click Install.

    On the Installed Operators page, the Migration Toolkit for Containers Operator appears in the openshift-migration project with the status Succeeded.

  5. Click Migration Toolkit for Containers Operator.

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

  7. Click Create.

  8. Click WorkloadsPods to verify that the MTC pods are running.

Installing the legacy Migration Toolkit for Containers Operator on OKD 3

You can install the legacy Migration Toolkit for Containers Operator manually on OKD 3.

Prerequisites
  • You must be logged in as a user with cluster-admin privileges on all clusters.

  • You must have access to registry.redhat.io.

  • You must have podman installed.

  • You must create an image stream secret and copy it to each node in the cluster.

  • You must have a Linux workstation with network access in order to download files from registry.redhat.io.

  • You must first install the Migration Toolkit for Containers Operator on the target cluster from a local registry.

Procedure
  1. Log in to registry.redhat.io with your Red Hat Customer Portal credentials:

    $ sudo podman login registry.redhat.io
  2. Download the operator.yml file for your OKD version:

    • OKD version 3.7:

      $ sudo podman cp $(sudo podman create \
        registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.5.1):/operator-3.7.yml ./
    • OKD version 3.9 to 3.11:

      $ sudo podman cp $(sudo podman create \
        registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.5.1):/operator.yml ./
  3. Download the controller.yml file:

    $ sudo podman cp $(sudo podman create \
      registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.5.1):/controller.yml ./
  4. Obtain the Operator image mapping by running the following command on the OKD 4 cluster:

    $ grep openshift-migration-legacy-rhel8-operator ./mapping.txt | grep rhmtc

    The output shows the mapping between the registry.redhat.io image and your mirror registry image.

    Example output
    registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator@sha256:468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a=<registry.apps.example.com>/rhmtc/openshift-migration-legacy-rhel8-operator
  5. Update the image values for the ansible and operator containers and the REGISTRY value in the operator.yml file:

    containers:
      - name: ansible
        image: <registry.apps.example.com>/rhmtc/openshift-migration-legacy-rhel8-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a> (1)
    ...
      - name: operator
        image: <registry.apps.example.com>/rhmtc/openshift-migration-legacy-rhel8-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a> (1)
    ...
        env:
        - name: REGISTRY
          value: <registry.apps.example.com> (2)
    1 Specify your mirror registry and the sha256 value of the Operator image.
    2 Specify your mirror registry.
  6. Log in to your OKD 3 cluster.

  7. Create the Migration Toolkit for Containers Operator object:

    $ oc create -f operator.yml
    Example output
    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 (1)
    Error from server (AlreadyExists): error when creating "./operator.yml":
    rolebindings.rbac.authorization.k8s.io "system:image-pullers" already exists
    1 You can ignore Error from server (AlreadyExists) messages. They are caused by the Migration Toolkit for Containers Operator creating resources for earlier versions of OKD 3 that are provided in later releases.
  8. Create the MigrationController object:

    $ oc create -f controller.yml
  9. Verify that the MTC pods are running:

    $ oc get pods -n openshift-migration

Configuring proxies

For OKD 4.1 and earlier versions, you must configure proxies in the MigrationController custom resource (CR) manifest after you install the Migration Toolkit for Containers Operator because these versions do not support a cluster-wide proxy object.

For OKD 4.2 to 4, the Migration Toolkit for Containers (MTC) inherits the cluster-wide proxy settings. You can change the proxy parameters if you want to override the cluster-wide proxy settings.

You must configure the proxies to allow the SPDY protocol and to forward the Upgrade HTTP header to the API server. Otherwise, an Upgrade request required error is displayed. The MigrationController CR uses SPDY to run commands within remote pods. The Upgrade HTTP header is required in order to open a websocket connection with the API server.

Direct volume migration

If you are performing a direct volume migration (DVM) from a source cluster behind a proxy, you must configure an Stunnel proxy. Stunnel creates a transparent tunnel between the source and target clusters for the TCP connection without changing the certificates.

DVM supports only one proxy. The source cluster cannot access the route of the target cluster if the target cluster is also behind a proxy.

Prerequisites
  • You must be logged in as a user with cluster-admin privileges on all clusters.

Procedure
  1. Get the MigrationController CR manifest:

    $ oc get migrationcontroller <migration_controller> -n openshift-migration
  2. Update the proxy parameters:

    apiVersion: migration.openshift.io/v1alpha1
    kind: MigrationController
    metadata:
      name: <migration_controller>
      namespace: openshift-migration
    ...
    spec:
      stunnel_tcp_proxy: http://<username>:<password>@<ip>:<port> (1)
      httpProxy: http://<username>:<password>@<ip>:<port> (2)
      httpsProxy: http://<username>:<password>@<ip>:<port> (3)
      noProxy: example.com (4)
    1 Stunnel proxy URL for direct volume migration.
    2 Proxy URL for creating HTTP connections outside the cluster. The URL scheme must be http.
    3 Proxy URL for creating HTTPS connections outside the cluster. If this is not specified, then httpProxy is used for both HTTP and HTTPS connections.
    4 Comma-separated list of destination domain names, domains, IP addresses, or other network CIDRs to exclude proxying.

    Preface a domain with . to match subdomains only. For example, .y.com matches x.y.com, but not y.com. Use * to bypass proxy for all destinations. If you scale up workers that are not included in the network defined by the networking.machineNetwork[].cidr field from the installation configuration, you must add them to this list to prevent connection issues.

    This field is ignored if neither the httpProxy nor the httpsProxy field is set.

  3. Save the manifest as migration-controller.yaml.

  4. Apply the updated manifest:

    $ oc replace -f migration-controller.yaml -n openshift-migration

For more information, see Configuring the cluster-wide proxy.

Configuring a replication repository

The Multicloud Object Gateway is the only supported option for a restricted network environment.

MTC supports the file system and snapshot data copy methods for migrating data from the source cluster to the target cluster. You can select a method that is suited for your environment and is supported by your storage provider.

Prerequisites

  • All clusters must have uninterrupted network access to the replication repository.

  • If you use a proxy server with an internally hosted replication repository, you must ensure that the proxy allows access to the replication repository.

Configuring the Multicloud Object Gateway

You can configure the Multicloud Object Gateway (MCG) as a replication repository for the Migration Toolkit for Containers (MTC). MCG is a component of OpenShift Container Storage.

Prerequisites
  • Ensure that you have downloaded the pull secret from the Red Hat OpenShift Cluster Manager site as shown in Obtaining the installation program in the installation documentation for your platform.

    If you have the pull secret, add the redhat-operators catalog to the OperatorHub custom resource (CR) as shown in Configuring OKD to use Red Hat Operators.

Procedure
  1. Deploy OpenShift Container Storage by using the appropriate OpenShift Container Storage deployment guide.

  2. Obtain the S3 endpoint, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY by running the describe command on the NooBaa custom resource.

    These values are required in order to add MCG as a replication repository to the MTC web console.

Additional resources for configuring a replication repository