Installing the Migration Toolkit for Containers

    By default, the MTC web console and the 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 remote cluster.

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

    To uninstall MTC, see .

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

    Definitions

    legacy platform

    OKD 4.5 and earlier.

    modern platform

    OKD 4.6 and later.

    legacy operator

    The MTC Operator designed for legacy platforms.

    modern operator

    The MTC Operator designed for modern platforms.

    control cluster

    The cluster that runs the MTC controller and GUI.

    remote cluster

    A source or destination cluster for a migration that runs Velero. The Control Cluster communicates with Remote clusters via the Velero API to drive migrations.

    Table 1. MTC compatibility: Migrating from a legacy platform
    OKD 4.5 or earlierOKD 4.6 or later

    Stable MTC version

    MTC 1.7.z

    Legacy 1.7 operator: Install manually with the operator.yml file.

    This cluster cannot be the control cluster.

    MTC 1.7.z

    Install with OLM, release channel release-v1.7

    Edge cases exist in which network restrictions prevent modern clusters from connecting to other clusters involved in the migration. For example, when migrating from an OKD 3.11 cluster on premises to a modern OKD cluster in the cloud, where the modern cluster cannot connect to the OKD 3.11 cluster.

    With MTC 1.7, if one of the remote clusters is unable to communicate with the control cluster because of network restrictions, use the crane tunnel-api command.

    With the stable MTC release, although you should always designate the most modern cluster as the control cluster, in this specific case it is possible to designate the legacy cluster as the control cluster and push workloads to the remote cluster.

    Installing the legacy Migration Toolkit for Containers Operator on OKD 4.2 to 4.5

    You can install the legacy Migration Toolkit for Containers Operator manually on OKD versions 4.2 to 4.5.

    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.

    Procedure

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

    2. Download the operator.yml file by entering the following command:

      1. $ sudo podman cp $(sudo podman create \
      2. registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/operator.yml ./
    3. Download the controller.yml file by entering the following command:

      1. $ sudo podman cp $(sudo podman create \
      2. registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/controller.yml ./
    4. Log in to your OKD source cluster.

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

      1. $ oc run test --image registry.redhat.io/ubi9 --command sleep infinity
    6. Create the Migration Toolkit for Containers Operator object:

      1. $ oc create -f operator.yml

      Example output

      1. namespace/openshift-migration created
      2. rolebinding.rbac.authorization.k8s.io/system:deployers created
      3. serviceaccount/migration-operator created
      4. customresourcedefinition.apiextensions.k8s.io/migrationcontrollers.migration.openshift.io created
      5. role.rbac.authorization.k8s.io/migration-operator created
      6. rolebinding.rbac.authorization.k8s.io/migration-operator created
      7. clusterrolebinding.rbac.authorization.k8s.io/migration-operator created
      8. deployment.apps/migration-operator created
      9. Error from server (AlreadyExists): error when creating "./operator.yml":
      10. rolebindings.rbac.authorization.k8s.io "system:image-builders" already exists (1)
      11. Error from server (AlreadyExists): error when creating "./operator.yml":
      12. rolebindings.rbac.authorization.k8s.io "system:image-pullers" already exists
    7. Create the MigrationController object:

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

      1. $ oc get pods -n openshift-migration

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

    Prerequisites

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

    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.

    Proxy configuration

    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.13, 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.

    Direct Volume Migration (DVM) was introduced in MTC 1.4.2. 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.

    If you want to perform a DVM from a source cluster behind a proxy, you must configure a TCP proxy that works at the transport layer and forwards the SSL connections transparently without decrypting and re-encrypting them with their own SSL certificates. A Stunnel proxy is an example of such a proxy.

    TCP proxy setup for DVM

    You can set up a direct connection between the source and the target cluster through a TCP proxy and configure the stunnel_tcp_proxy variable in the MigrationController CR to use the proxy:

    1. apiVersion: migration.openshift.io/v1alpha1
    2. kind: MigrationController
    3. metadata:
    4. name: migration-controller
    5. namespace: openshift-migration
    6. spec:
    7. [...]
    8. stunnel_tcp_proxy: http://username:password@ip:port

    Direct volume migration (DVM) supports only basic authentication for the proxy. Moreover, DVM works only from behind proxies that can tunnel a TCP connection transparently. HTTP/HTTPS proxies in man-in-the-middle mode do not work. The existing cluster-wide proxies might not support this behavior. As a result, the proxy settings for DVM are intentionally kept different from the usual proxy configuration in MTC.

    Why use a TCP proxy instead of an HTTP/HTTPS proxy?

    You can enable DVM by running Rsync between the source and the target cluster over an OpenShift route. Traffic is encrypted using Stunnel, a TCP proxy. The Stunnel running on the source cluster initiates a TLS connection with the target Stunnel and transfers data over an encrypted channel.

    Cluster-wide HTTP/HTTPS proxies in OpenShift are usually configured in man-in-the-middle mode where they negotiate their own TLS session with the outside servers. However, this does not work with Stunnel. Stunnel requires that its TLS session be untouched by the proxy, essentially making the proxy a transparent tunnel which simply forwards the TCP connection as-is. Therefore, you must use a TCP proxy.

    Known issue

    Migration fails with error Upgrade request required

    The migration Controller uses the SPDY protocol to execute commands within remote pods. If the remote cluster is behind a proxy or a firewall that does not support the SPDY protocol, the migration controller fails to execute remote commands. The migration fails with the error message Upgrade request required. Workaround: Use a proxy that supports the SPDY protocol.

    In addition to supporting the SPDY protocol, the proxy or firewall also must pass the Upgrade HTTP header to the API server. The client uses this header to open a websocket connection with the API server. If the Upgrade header is blocked by the proxy or firewall, the migration fails with the error message Upgrade request required. Workaround: Ensure that the proxy forwards the Upgrade header.

    Tuning network policies for migrations

    OpenShift supports restricting traffic to or from pods using NetworkPolicy or EgressFirewalls based on the network plugin used by the cluster. If any of the source namespaces involved in a migration use such mechanisms to restrict network traffic to pods, the restrictions might inadvertently stop traffic to Rsync pods during migration.

    Rsync pods running on both the source and the target clusters must connect to each other over an OpenShift Route. Existing NetworkPolicy or EgressNetworkPolicy objects can be configured to automatically exempt Rsync pods from these traffic restrictions.

    NetworkPolicy configuration

    Egress traffic from Rsync pods

    You can use the unique labels of Rsync pods to allow egress traffic to pass from them if the NetworkPolicy configuration in the source or destination namespaces blocks this type of traffic. The following policy allows all egress traffic from Rsync pods in the namespace:

    1. apiVersion: networking.k8s.io/v1
    2. kind: NetworkPolicy
    3. metadata:
    4. name: allow-all-egress-from-rsync-pods
    5. spec:
    6. podSelector:
    7. matchLabels:
    8. owner: directvolumemigration
    9. app: directvolumemigration-rsync-transfer
    10. egress:
    11. - {}
    12. policyTypes:
    13. - Egress
    Ingress traffic to Rsync pods
    1. apiVersion: networking.k8s.io/v1
    2. kind: NetworkPolicy
    3. metadata:
    4. name: allow-all-egress-from-rsync-pods
    5. spec:
    6. podSelector:
    7. matchLabels:
    8. owner: directvolumemigration
    9. app: directvolumemigration-rsync-transfer
    10. ingress:
    11. - {}
    12. policyTypes:
    13. - Ingress

    EgressNetworkPolicy configuration

    The EgressNetworkPolicy object or Egress Firewalls are OpenShift constructs designed to block egress traffic leaving the cluster.

    Based on which cluster the Egress Firewall is present in, you can add the CIDR range of the other cluster to allow egress traffic between the two:

    1. apiVersion: network.openshift.io/v1
    2. kind: EgressNetworkPolicy
    3. metadata:
    4. name: test-egress-policy
    5. namespace: <namespace>
    6. spec:
    7. egress:
    8. - to:
    9. cidrSelector: <cidr_of_source_or_target_cluster>
    10. type: Deny

    Choosing alternate endpoints for data transfer

    By default, DVM uses an OKD route as an endpoint to transfer PV data to destination clusters. You can choose another type of supported endpoint, if cluster topologies allow.

    For each cluster, you can configure an endpoint by setting the rsync_endpoint_type variable on the appropriate destination cluster in your MigrationController CR:

    1. apiVersion: migration.openshift.io/v1alpha1
    2. kind: MigrationController
    3. metadata:
    4. name: migration-controller
    5. namespace: openshift-migration
    6. spec:
    7. [...]
    8. rsync_endpoint_type: [NodePort|ClusterIP|Route]

    Configuring supplemental groups for Rsync pods

    When your PVCs use a shared storage, you can configure the access to that storage by adding supplemental groups to Rsync pod definitions in order for the pods to allow access:

    Table 2. Supplementary groups for Rsync pods
    VariableTypeDefaultDescription

    src_supplemental_groups

    string

    Not set

    Comma-separated list of supplemental groups for source Rsync pods

    target_supplemental_groups

    string

    Not set

    Comma-separated list of supplemental groups for target Rsync pods

    Example usage

    The MigrationController CR can be updated to set values for these supplemental groups:

    1. spec:
    2. src_supplemental_groups: "1000,2000"
    3. target_supplemental_groups: "2000,3000"

    Configuring proxies

    Prerequisites

    Procedure

    1. Get the MigrationController CR manifest:

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

      1. apiVersion: migration.openshift.io/v1alpha1
      2. metadata:
      3. name: <migration_controller>
      4. namespace: openshift-migration
      5. ...
      6. spec:
      7. stunnel_tcp_proxy: http://<username>:<password>@<ip>:<port> (1)
      8. noProxy: example.com (2)
      1Stunnel proxy URL for direct volume migration.
      2Comma-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:

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

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

    This section applies only when you are working with the OpenShift API, not the web console.

    OpenShift environments have the PodSecurityAdmission controller enabled by default. This controller requires cluster administrators to enforce Pod Security Standards by means of namespace labels. All workloads in the cluster are expected to run one of the following Pod Security Standard levels: Privileged, Baseline or Restricted. Every cluster has its own default policy set.

    To guarantee successful data transfer in all environments, Migration Toolkit for Containers (MTC) 1.7.5 introduced changes in Rsync pods, including running Rsync pods as non-root user by default. This ensures that data transfer is possible even for workloads that do not necessarily require higher privileges. This change was made because it is best to run workloads with the lowest level of privileges possible.

    Manually overriding default non-root operation for data trannsfer

    Although running Rsync pods as non-root user works in most cases, data transfer might fail when you run workloads as root user on the source side. MTC provides two ways to manually override default non-root operation for data transfer:

    • Configure all migrations to run an Rsync pod as root on the destination cluster for all migrations.

    • Run an Rsync pod as root on the destination cluster per migration.

    In both cases, you must set the following labels on the source side of any namespaces that are running workloads with higher privileges prior to migration: enforce, audit, and warn.

    To learn more about Pod Security Admission and setting values for labels, see .

    Configuring the MigrationController CR as root or non-root for all migrations

    By default, Rsync runs as non-root.

    On the destination cluster, you can configure the MigrationController CR to run Rsync as root.

    Procedure

    • Configure the MigrationController CR as follows:

      1. apiVersion: migration.openshift.io/v1alpha1
      2. kind: MigrationController
      3. metadata:
      4. name: migration-controller
      5. namespace: openshift-migration
      6. spec:
      7. [...]
      8. migration_rsync_privileged: true

      This configuration will apply to all future migrations.

    Configuring the MigMigration CR as root or non-root per migration

    On the destination cluster, you can configure the MigMigration CR to run Rsync as root or non-root, with the following non-root options:

    • As a specific user ID (UID)

    • As a specific group ID (GID)

    Procedure

    1. To run Rsync as root, configure the MigMigration CR according to this example:

      1. apiVersion: migration.openshift.io/v1alpha1
      2. kind: MigMigration
      3. metadata:
      4. name: migration-controller
      5. namespace: openshift-migration
      6. spec:
      7. [...]
      8. runAsRoot: true
    2. To run Rsync as a specific User ID (UID) or as a specific Group ID (GID), configure the MigMigration CR according to this example:

    You must configure an object storage to use as a replication repository. The Migration Toolkit for Containers (MTC) copies data from the source cluster to the replication repository, and then from the replication repository to the target cluster.

    MTC supports the for migrating data from the source cluster to the target cluster. Select a method that is suited for your environment and is supported by your storage provider.

    MTC supports the following storage providers:

    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.

    Retrieving Multicloud Object Gateway credentials

    You must retrieve the Multicloud Object Gateway (MCG) credentials and S3 endpoint in order to configure MCG as a replication repository for the Migration Toolkit for Containers (MTC). You must retrieve the Multicloud Object Gateway (MCG) credentials in order to create a Secret custom resource (CR) for the OpenShift API for Data Protection (OADP).

    MCG is a component of OpenShift Data Foundation.

    Prerequisites

    • Ensure that you have downloaded the pull secret from the Red Hat OpenShift Cluster Manager 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.

    • You must deploy OpenShift Data Foundation by using the appropriate .

    Procedure

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

      You use these credentials to add MCG as a replication repository.

    You configure Amazon Web Services (AWS) S3 object storage as a replication repository for the Migration Toolkit for Containers (MTC).

    Prerequisites

    • You must have the AWS CLI installed.

    • The AWS S3 storage bucket must be accessible to the source and target clusters.

    • If you are using the snapshot copy method:

      • You must have access to EC2 Elastic Block Storage (EBS).

      • The source and target clusters must be in the same region.

      • The source and target clusters must have the same storage class.

    Procedure

    1. Set the BUCKET variable:

      1. $ BUCKET=<your_bucket>
    2. Set the REGION variable:

      1. $ REGION=<your_region>
    3. Create an AWS S3 bucket:

      1. $ aws s3api create-bucket \
      2. --bucket $BUCKET \
      3. --region $REGION \
      4. --create-bucket-configuration LocationConstraint=$REGION (1)
    4. Create an IAM user:

      1. $ aws iam create-user --user-name velero (1)
      1If you want to use Velero to back up multiple clusters with multiple S3 buckets, create a unique user name for each cluster.
    5. Create a velero-policy.json file:

      1. $ cat > velero-policy.json <<EOF
      2. {
      3. "Version": "2012-10-17",
      4. "Statement": [
      5. {
      6. "Effect": "Allow",
      7. "Action": [
      8. "ec2:DescribeVolumes",
      9. "ec2:DescribeSnapshots",
      10. "ec2:CreateTags",
      11. "ec2:CreateVolume",
      12. "ec2:CreateSnapshot",
      13. "ec2:DeleteSnapshot"
      14. ],
      15. "Resource": "*"
      16. },
      17. {
      18. "Effect": "Allow",
      19. "Action": [
      20. "s3:GetObject",
      21. "s3:DeleteObject",
      22. "s3:PutObject",
      23. "s3:AbortMultipartUpload",
      24. "s3:ListMultipartUploadParts"
      25. ],
      26. "Resource": [
      27. "arn:aws:s3:::${BUCKET}/*"
      28. ]
      29. },
      30. {
      31. "Effect": "Allow",
      32. "Action": [
      33. "s3:ListBucket",
      34. "s3:GetBucketLocation",
      35. "s3:ListBucketMultipartUploads"
      36. ],
      37. "Resource": [
      38. "arn:aws:s3:::${BUCKET}"
      39. ]
      40. }
      41. ]
      42. }
      43. EOF
    6. Attach the policies to give the velero user the minimum necessary permissions:

      1. $ aws iam put-user-policy \
      2. --user-name velero \
      3. --policy-name velero \
      4. --policy-document file://velero-policy.json
    7. Create an access key for the user:

      1. $ aws iam create-access-key --user-name velero

      Example output

      1. {
      2. "AccessKey": {
      3. "UserName": "velero",
      4. "Status": "Active",
      5. "CreateDate": "2017-07-31T22:24:41.576Z",
      6. "SecretAccessKey": <AWS_SECRET_ACCESS_KEY>,
      7. }
      8. }

      Record the AWS_SECRET_ACCESS_KEY and the AWS_ACCESS_KEY_ID. You use the credentials to add AWS as a replication repository.

    Configuring Google Cloud Platform

    You configure a Google Cloud Platform (GCP) storage bucket as a replication repository for the Migration Toolkit for Containers (MTC).

    Prerequisites

    • You must have the gcloud and gsutil CLI tools installed. See the Google cloud documentation for details.

    • The GCP storage bucket must be accessible to the source and target clusters.

    • If you are using the snapshot copy method:

      • The source and target clusters must be in the same region.

      • The source and target clusters must have the same storage class.

      • The storage class must be compatible with snapshots.

    Procedure

    1. Log in to GCP:

      1. $ gcloud auth login
    2. Set the BUCKET variable:

      1. $ BUCKET=<bucket> (1)
      1Specify your bucket name.
    3. Create the storage bucket:

      1. $ gsutil mb gs://$BUCKET/
    4. Set the PROJECT_ID variable to your active project:

      1. $ PROJECT_ID=$(gcloud config get-value project)
    5. Create a service account:

      1. $ gcloud iam service-accounts create velero \
      2. --display-name "Velero service account"
    6. List your service accounts:

      1. $ gcloud iam service-accounts list
    7. Set the SERVICE_ACCOUNT_EMAIL variable to match its email value:

      1. $ SERVICE_ACCOUNT_EMAIL=$(gcloud iam service-accounts list \
      2. --filter="displayName:Velero service account" \
      3. --format 'value(email)')
    8. Attach the policies to give the velero user the minimum necessary permissions:

      1. $ ROLE_PERMISSIONS=(
      2. compute.disks.get
      3. compute.disks.create
      4. compute.disks.createSnapshot
      5. compute.snapshots.get
      6. compute.snapshots.create
      7. compute.snapshots.useReadOnly
      8. compute.snapshots.delete
      9. compute.zones.get
      10. storage.objects.create
      11. storage.objects.delete
      12. storage.objects.get
      13. storage.objects.list
      14. iam.serviceAccounts.signBlob
      15. )
    9. Create the velero.server custom role:

      1. $ gcloud iam roles create velero.server \
      2. --project $PROJECT_ID \
      3. --title "Velero Server" \
      4. --permissions "$(IFS=","; echo "${ROLE_PERMISSIONS[*]}")"
    10. Add IAM policy binding to the project:

      1. $ gcloud projects add-iam-policy-binding $PROJECT_ID \
      2. --member serviceAccount:$SERVICE_ACCOUNT_EMAIL \
      3. --role projects/$PROJECT_ID/roles/velero.server
    11. Update the IAM service account:

    12. Save the IAM service account keys to the credentials-velero file in the current directory:

      1. $ gcloud iam service-accounts keys create credentials-velero \
      2. --iam-account $SERVICE_ACCOUNT_EMAIL

      You use the credentials-velero file to add GCP as a replication repository.

    Configuring Microsoft Azure

    You configure a Microsoft Azure Blob storage container as a replication repository for the Migration Toolkit for Containers (MTC).

    Prerequisites

    • You must have the Azure CLI installed.

    • The Azure Blob storage container must be accessible to the source and target clusters.

    • If you are using the snapshot copy method:

      • The source and target clusters must be in the same region.

      • The source and target clusters must have the same storage class.

      • The storage class must be compatible with snapshots.

    Procedure

    1. Log in to Azure:

      1. $ az login
    2. Set the AZURE_RESOURCE_GROUP variable:

      1. $ AZURE_RESOURCE_GROUP=Velero_Backups
    3. Create an Azure resource group:

      1. $ az group create -n $AZURE_RESOURCE_GROUP --location CentralUS (1)
      1Specify your location.
    4. Set the AZURE_STORAGE_ACCOUNT_ID variable:

      1. $ AZURE_STORAGE_ACCOUNT_ID="velero$(uuidgen | cut -d '-' -f5 | tr '[A-Z]' '[a-z]')"
    5. Create an Azure storage account:

      1. $ az storage account create \
      2. --name $AZURE_STORAGE_ACCOUNT_ID \
      3. --resource-group $AZURE_RESOURCE_GROUP \
      4. --sku Standard_GRS \
      5. --encryption-services blob \
      6. --https-only true \
      7. --kind BlobStorage \
      8. --access-tier Hot
    6. Set the BLOB_CONTAINER variable:

      1. $ BLOB_CONTAINER=velero
    7. Create an Azure Blob storage container:

      1. $ az storage container create \
      2. -n $BLOB_CONTAINER \
      3. --public-access off \
      4. --account-name $AZURE_STORAGE_ACCOUNT_ID
    8. Create a service principal and credentials for velero:

      1. $ AZURE_SUBSCRIPTION_ID=`az account list --query '[?isDefault].id' -o tsv` \
      2. AZURE_TENANT_ID=`az account list --query '[?isDefault].tenantId' -o tsv` \
      3. AZURE_CLIENT_SECRET=`az ad sp create-for-rbac --name "velero" \
      4. --role "Contributor" --query 'password' -o tsv` \
      5. AZURE_CLIENT_ID=`az ad sp list --display-name "velero" \
      6. --query '[0].appId' -o tsv`
    9. Save the service principal credentials in the credentials-velero file:

      1. $ cat << EOF > ./credentials-velero
      2. AZURE_SUBSCRIPTION_ID=${AZURE_SUBSCRIPTION_ID}
      3. AZURE_TENANT_ID=${AZURE_TENANT_ID}
      4. AZURE_CLIENT_ID=${AZURE_CLIENT_ID}
      5. AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET}
      6. AZURE_RESOURCE_GROUP=${AZURE_RESOURCE_GROUP}
      7. AZURE_CLOUD_NAME=AzurePublicCloud
      8. EOF

      You use the credentials-velero file to add Azure as a replication repository.

    Uninstalling MTC and deleting resources

    You can uninstall the Migration Toolkit for Containers (MTC) and delete its resources to clean up the cluster.

    Prerequisites

    • You must be logged in as a user with cluster-admin privileges.

    Procedure

    1. Delete the MigrationController custom resource (CR) on all clusters:

      1. $ oc delete migrationcontroller <migration_controller>
    2. Uninstall the Migration Toolkit for Containers Operator on OKD 4 by using the Operator Lifecycle Manager.

    3. Delete cluster-scoped resources on all clusters by running the following commands:

      • migration custom resource definitions (CRDs):

        1. $ oc delete $(oc get crds -o name | grep 'migration.openshift.io')
      • velero CRDs:

        1. $ oc delete $(oc get crds -o name | grep 'velero')
      • migration cluster roles:

        1. $ oc delete $(oc get clusterroles -o name | grep 'migration.openshift.io')
      • migration-operator cluster role:

        1. $ oc delete clusterrole migration-operator
      • velero cluster roles:

        1. $ oc delete $(oc get clusterroles -o name | grep 'velero')
      • migration cluster role bindings:

        1. $ oc delete $(oc get clusterrolebindings -o name | grep 'migration.openshift.io')
      • migration-operator cluster role bindings:

        1. $ oc delete clusterrolebindings migration-operator
      • velero cluster role bindings: