3.2. 在 OpenShift Container Platform 4.2 到 4.5 上安装旧的 MTC Operator

您可以在 OpenShift Container Platform 版本 4.2 到 4.5 中手动安装旧的 MTC Operator。

先决条件

  • 必须使用在所有集群中具有 cluster-admin 权限的用户登录。
  • 您必须有权访问 registry.redhat.io
  • 必须安装 podman

流程

  1. 使用您的红帽客户门户网站账户登陆到 registry.redhat.io

    $ podman login registry.redhat.io
  2. 输入以下命令下载 operator.yml 文件:

    podman cp $(podman create registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/operator.yml ./
  3. 输入以下命令下载 controller.yml 文件:

    podman cp $(podman create registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/controller.yml ./
  4. 登录您的 OpenShift Container Platform 源集群。
  5. 验证集群可以在 registry.redhat.io 中进行身份验证:

    $ oc run test --image registry.redhat.io/ubi8 --command sleep infinity
  6. 创建 MTC Operator 对象的 Migration Toolkit:

    $ 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 1
    Error from server (AlreadyExists): error when creating "./operator.yml":
    rolebindings.rbac.authorization.k8s.io "system:image-pullers" already exists

    1
    您可以忽略 Error from server (AlreadyExists) 信息。它们是由 MTC Operator 为早期版本的 OpenShift Container Platform 4 创建资源造成的,这些资源在以后的版本中已提供。
  7. 创建 MigrationController 对象:

    $ oc create -f controller.yml
  8. 验证 MTC Pod 是否正在运行:

    $ oc get pods -n openshift-migration