7.3. OpenShift Container Platform 3 でのレガシー Migration Toolkit for Containers Operator のインストール

レガシー Migration Toolkit for Containers Operator を手動で OpenShift Container Platform 3 にインストールできます。

前提条件

  • cluster-admin 権限を持つユーザーとしてすべてのクラスターにログインしている必要があります。
  • registry.redhat.io にアクセスできる必要があります。
  • podman がインストールされている必要があります。
  • イメージストリームのシークレット を作成し、これをクラスター内の各ノードにコピーする必要があります。
  • registry.redhat.io からファイルをダウンロードするには、ネットワークアクセスのある Linux ワークステーションが必要です。
  • Operator カタログのミラーイメージを作成する必要があります。
  • ミラーリングされた Operator カタログから Migration Toolkit for Containers Operator を OpenShift Container Platform 4.8 にインストールする必要があります。

手順

  1. Red Hat カスタマーポータルの認証情報を使用して registry.redhat.io にログインします。

    $ sudo podman login registry.redhat.io
  2. 次のコマンドを実行して、operator.yml ファイルをダウンロードします。

    $ sudo podman cp $(sudo podman create \
      registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/operator.yml ./
  3. 次のコマンドを実行して、controller.yml ファイルをダウンロードします。

    $ sudo podman cp $(sudo podman create \
      registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator:v1.7):/controller.yml ./
  4. 以下のコマンドを実行して、Operator イメージマッピングを取得します。

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

    mapping.txt ファイルは Operator カタログのミラーリング時に作成されました。出力には、registry.redhat.io イメージとミラーレジストリーイメージ間のマッピングが表示されます。

    出力例

    registry.redhat.io/rhmtc/openshift-migration-legacy-rhel8-operator@sha256:468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a=<registry.apps.example.com>/rhmtc/openshift-migration-legacy-rhel8-operator

  5. ansible および operator コンテナーの image 値、および operator.yml ファイルの REGISTRY 値を更新します。

    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> 2
    ...
        env:
        - name: REGISTRY
          value: <registry.apps.example.com> 3
    1 2
    ミラーレジストリーおよび Operator イメージの sha256 値を指定します。
    3
    ミラーレジストリーを指定します。
  6. ソースクラスターにログインします。
  7. Migration Toolkit for Containers Operator オブジェクトを作成します。

    $ 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) メッセージは無視できます。これらは、以降のリソースで提供される OpenShift Container Platform 4 以前のバージョン用にリソースを作成する Migration Toolkit for Containers Operator が原因です。
  8. MigrationController オブジェクトを作成します。

    $ oc create -f controller.yml
  9. MTC Pod が実行されていることを確認します。

    $ oc get pods -n openshift-migration