Installing the Cluster Application Migration Operator on an OpenShift Container Platform 4.2 source cluster

You can install the Cluster Application Migration Operator on an OpenShift Container Platform 4.2 source cluster with OLM.

The Cluster Application Migration Operator installs Restic and Velero.

Procedure
  1. In the OpenShift Container Platform web console, click AdministrationNamespaces.

  2. On the Namespaces page:

    1. Click Create Namespace.

    2. Enter openshift-migration in the Name field and click Create.

  3. Click OperatorsOperatorHub.

  4. On the OperatorHub page:

    1. Scroll or type a keyword into the Filter by keyword field (in this case, Migration) to find the Cluster Application Migration Operator.

    2. Select the Cluster Application Migration Operator and click Install.

  5. On the Create Operator Subscription page:

    1. Select the openshift-migration namespace if it is not already selected.

    2. Select an Automatic or Manual approval strategy.

    3. Click Subscribe.

  6. Click OperatorsInstalled Operators.

    The Cluster Application Migration Operator is listed in the openshift-migration project with the status InstallSucceeded.

  7. On the Installed Operators page:

    1. Under Provided APIs, click View 12 more…​.

    2. Click Create NewMigrationController.

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

      spec:
        [...]
        migration_controller: false
        migration_ui: false
        [...]
    4. Click Create.

  8. Click WorkloadsPods to verify that the Restic and Velero Pods are running.

Installing the Cluster Application Migration Operator on an OpenShift Container Platform 4.2 target cluster

You can install the Cluster Application Migration Operator on an OpenShift Container Platform 4.2 target cluster with OLM.

The Cluster Application Migration Operator installs the following on the target cluster:

  • Migration controller CR

  • CAM web console

  • Restic

  • Velero

Procedure
  1. In the OpenShift Container Platform web console, click AdministrationNamespaces.

  2. On the Namespaces page:

    1. Click Create Namespace.

    2. Enter openshift-migration in the Name field and click Create.

  3. Click OperatorsOperatorHub.

  4. On the OperatorHub page:

    1. Scroll or type a keyword into the Filter by keyword field (in this case, Migration) to find the Cluster Application Migration Operator.

    2. Select the Cluster Application Migration Operator and click Install.

  5. On the Create Operator Subscription page:

    1. Select the openshift-migration namespace if it is not already selected.

    2. Select an Automatic or Manual approval strategy.

    3. Click Subscribe.

  6. Click OperatorsInstalled Operators.

    The Cluster Application Migration Operator is listed in the openshift-migration project with the status InstallSucceeded.

  7. On the Installed Operators page:

    1. Under Provided APIs, click View 12 more…​.

    2. Click Create NewMigrationController.

    3. Click Create.

  8. Click WorkloadsPods to verify that the Controller Manager, Migration UI, Restic, and Velero Pods are running.

Configuring cross-origin resource sharing on an OpenShift Container Platform 4.2 source cluster

You must configure cross-origin resource sharing on an OpenShift Container Platform 4.2 source cluster to enable communication between the source cluster’s API server and the CAM tool.

Procedure
  1. Log in to the cluster on which the CAM tool is installed.

  2. Obtain the value for your CORS configuration:

    $ oc get -n openshift-migration route/migration -o go-template='(?i)//{{ .spec.host }}(:|\z){{ println }}' | sed 's,\.,\\.,g'
  3. Log in to the source cluster.

  4. Edit the Kubernetes API server CR:

    $ oc edit apiserver.config.openshift.io cluster
  5. Add the CORS configuration value to additionalCORSAllowedOrigins in the spec stanza:

    spec:
      additionalCORSAllowedOrigins:
      - (?i)//migration-openshift-migration\.apps\.cluster\.com(:|\z) (1)
    1 Specify your CORS configuration value.
  6. Save the file to apply the changes.

  7. Verify the configuration:

    $ curl -v -k -X OPTIONS \
    "<cluster_url>/apis/migration.openshift.io/v1alpha1/namespaces/openshift-migration/migclusters" \ (1)
    -H "Access-Control-Request-Method: GET" \
    -H "Access-Control-Request-Headers: authorization" \
    -H "Origin: https://<CAM_web_console_url>" (2)
    1 Specify the URL of your CORS configured cluster.
    2 Specify the URL of your CAM web console. The URL is based on the CORS configuration value, for example, https://migration-openshift-migration.apps.cluster.

    The output appears similar to the following:

    < HTTP/2 204
    < access-control-allow-credentials: true
    < access-control-allow-headers: Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, X-Requested-With, If-Modified-Since
    < access-control-allow-methods: POST, GET, OPTIONS, PUT, DELETE, PATCH
    < access-control-allow-origin: https://migration-openshift-migration.apps.cluster
    < access-control-expose-headers: Date
    < cache-control: no-store