Skip to content

migtools/mig-operator

Repository files navigation

Crane Operator

Crane Operator (mig-operator) installs a system of migration components for moving workloads from OpenShift 3 to 4.

Installable Component Repository
Velero + Custom Migration Plugins velero, openshift-migration-plugin
Migration Controller mig-controller
Migration UI mig-ui

Demos

Contents


Development

See hacking.md for instructions on installing unreleased versions of mig-operator.

Crane Operator Installation

See OpenShift version Compatibility for info on appropriate Crane versions for your OpenShift versions.

OpenShift 4

Crane Operator is installable on OpenShift 4 via OperatorHub.

Installing released versions

  1. Visit the OpenShift Web Console.
  2. Navigate to Operators => OperatorHub.
  3. Search for Crane Operator.
  4. Install the desired Crane Operator version.

Installing latest

See hacking.md

OpenShift 3

Crane Operator is installable on OpenShift 3 via OpenShift manifest.

Installing released versions

Obtain the operator.yml and controller-3.yml for the desired version. Visit Quay for a list of valid tags. Stable releases are tagged as release-x.y.z. Latest is used for development and may be unstable.

podman cp $(podman create quay.io/konveyor/mig-operator-container:<tag>):/operator.yml ./
podman cp $(podman create quay.io/konveyor/mig-operator-container:<tag>):/controller-3.yml ./
oc create -f operator.yml

Crane Operator Upgrades

See the MTC Upgrade Documentation.

Component Installation and Configuration

Component installation and configuration is accomplished by creating or modifying a MigrationController CR.

Installation Topology

You must install Crane Operator and components on all OpenShift clusters involved in a migration.

Use Case Recommended Topology
Migrating from OpenShift 3 => 4 Install Velero on all clusters. Install the Controller and UI on the OpenShift 4 cluster.
Migrating from OpenShift 3 => 3 Install Velero on all clusters. Install the Controller and UI on the target cluster.

Customizing your Installation

You can choose components to install by setting parameters MigrationController CR spec

Parameter Name Usage Recommended Setting
migration_velero Set to true to install Velero and Restic. Set to true on all clusters.
migration_controller Set to true to install the Migration Controller Set to true only on one cluster, preferably OpenShift 4.
migration_ui Set to true to install the Migration UI Set to true only where migration_controller: true.

Installing Crane Components

Creating a MigrationController CR will tell Crane Operator to install Migration Components.

OpenShift 4

  1. In the OpenShift console navigate to Operators => Installed Operators.
  2. Click on Crane Operator.
  3. Find MigrationController on the Provided APIs page and click Create Instance.
  4. On OpenShift 4.5+, click the Configure via: YAML view radio button.
  5. Customize settings (component selections, migration size limits) in the YAML editor, and click Create.

OpenShift 3

  1. Review the controller-3.yml retrieved earlier.
  2. Adjust settings (component selections, migration size limits) if desired.
  3. Set mig_ui_cluster_api_endpoint to point at the Controller cluster APIserver URL/Port.
  4. Run oc create -f controller-3.yml

Additional Settings

Additional settings can be applied by editing the MigrationController CR.

oc edit migrationcontroller -n openshift-migration

Restic Timeout

spec:
  restic_timeout: 1h

The default restic_timeout is 1 hour, specified as 1h. You can increase this if you anticipate doing large backups that will take longer than 1 hour so that your backups will succeed. The downside to increasing this value is that it may delay returning from unanticipated errors in some scenarios. Valid units are s, m, and h, which stand for second, minute, and hour.

Migration Limits

spec:
  mig_pv_limit: '100'
  mig_pod_limit: '100'
  mig_namespace_limit: '10'

Setting for the max allowable number of resources in a Migration Plan. The default limits serve as a recommendation to break up large scale migrations into several smaller Migration Plans.

Migration Example Using API

CORS (Cross-Origin Resource Sharing) Configuration

You must follow the CORs configuration steps only if:

  • You are installing Crane Operator 1.1.1 or older
  • You are installing Migration Controller and Migration UI on OpenShift 3

Removing Crane Operator

To clean up all the resources created by the operator you can do the following:

oc delete namespace openshift-migration

oc delete crd backups.velero.io backupstoragelocations.velero.io deletebackuprequests.velero.io downloadrequests.velero.io migrationcontrollers.migration.openshift.io podvolumebackups.velero.io podvolumerestores.velero.io resticrepositories.velero.io restores.velero.io schedules.velero.io serverstatusrequests.velero.io volumesnapshotlocations.velero.io

oc delete clusterrole migration-manager-role manager-role

oc delete clusterrolebindings migration-operator velero mig-cluster-admin migration-manager-rolebinding manager-rolebinding

oc delete oauthclient migration

Resources Migrated By Crane Operator

Please refer to Resources Migrated By Crane Operator in order to gain insights regarding what kind of objects/resources get migrated by the Crane Operator.

Direct Migration Requirements

In MTC 1.4.0, a new feature called Direct Migration is available that will yield significant time savings for most customers migrating persistent volumes and/or internal images. Direct Migration enables the migration of persistent volumes and internal images directly from the source cluster to the destination cluster without an intermediary replication repository. This introduces a significant performance enhancement while also providing better error and progress reporting information back to the end-user. Please refer the Direct Migration Requirements documentation for more details.