This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.1.4. クラスターアプリケーション移行ツールのデプロイ
Cluster Application Migration Operator を OpenShift Container Platform 4.3 ターゲットクラスターおよび OpenShift Container Platform 3 ソースクラスターにインストールできます。Cluster Application Migration Operator は、デフォルトで Cluster Application Migration (CAM) ツールをターゲットクラスターにインストールします。
オプション: Cluster Application Migration Operator を、CAM ツールを OpenShift Container Platform 3 クラスターまたはリモートクラスターにインストールするように設定できます。
制限された環境では、ローカルミラーレジストリーから Cluster Application Migration Operator をインストールできます。
クラスターに Cluster Application Migration Operator をインストールした後に、CAM ツールを起動できます。
1.4.1. Cluster Application Migration Operator のインストール
Cluster Application Migration Operator は Operator Lifecycle Manager (OLM) で OpenShift Container Platform 4.3 ターゲットクラスターにインストールすることも、手動で OpenShift Container Platform 3 ソースクラスターにインストールすることもできます。
1.4.1.1. Cluster Application Migration Operator の OpenShift Container Platform 4.3 ターゲットクラスターへのインストール
Operator Lifecycle Manager (OLM) を使用して OpenShift Container Platform 4.3 ターゲットクラスターに Cluster Application Migration Operator をインストールできます。
Cluster Application Migration Operator は、デフォルトで Cluster Application Migration ツールをターゲットクラスターにインストールします。
手順
-
OpenShift Container Platform Web コンソールで、Operators
OperatorHub をクリックします。 -
Filter by keyword フィールド (この場合は
Migration
) を使用して Cluster Application Migration Operator を見つけます。 - Cluster Application Migration Operator を選択し、Install をクリックします。
-
Create Operator Subscription ページで
openshift-migration
namespace を選択し、承認ストラテジーを指定します。 Subscribe をクリックします。
Installed Operators ページで、Cluster Application Migration Operator は、InstallSucceeded のステータスで openshift-migration プロジェクトに表示されます。
- Provided APIs の下で、View 12 more… をクリックします。
-
Create New
MigrationController をクリックします。 - Create をクリックします。
-
Workloads
Pods をクリックし、Controller Manager、Migration UI、Restic、および Velero Pod が実行中であることを確認します。
1.4.1.2. OpenShift Container Platform 3 ソースクラスターへの Cluster Application Migration Operator のインストール
Cluster Application Migration Operator を手動でOpenShift Container Platform 3 ソースクラスターにインストールできます。
前提条件
-
registry.redhat.io
へのアクセス イメージを
registry.redhat.io
からプルするように設定された OpenShift Container Platform 3 クラスターイメージをプルするには、
imagestreamsecret
を作成し、これをクラスター内の各ノードにコピーする必要があります。
手順
Red Hat カスタマーポータルの認証情報を使用して
registry.redhat.io
にログインします。sudo podman login registry.redhat.io
$ sudo podman login registry.redhat.io
Copy to Clipboard Copied! 注記システムがルートレス Podman コンテナー用に設定されている場合は、この手順に
sudo
は必要ありません。operator.yml
ファイルをダウンロードします。sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/operator.yml ./
$ sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/operator.yml ./
Copy to Clipboard Copied! controller-3.yml
ファイルをダウンロードします。sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/controller-3.yml ./
$ sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/controller-3.yml ./
Copy to Clipboard Copied! - OpenShift Container Platform 3 クラスターにログインします。
クラスターが
registry.redhat.io
で認証できることを確認します。oc run test --image registry.redhat.io/ubi8 --command sleep infinity
$ oc run test --image registry.redhat.io/ubi8 --command sleep infinity
Copy to Clipboard Copied! Cluster Application Migration Operator CR オブジェクトを作成します。
oc create -f operator.yml
$ oc create -f operator.yml
Copy to Clipboard Copied! 出力は以下のようになります。
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 Error from server (AlreadyExists): error when creating "./operator.yml": rolebindings.rbac.authorization.k8s.io "system:image-pullers" already exists
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
Copy to Clipboard Copied! - 1
Error from server (AlreadyExists)
メッセージは無視できます。これらは、Cluster Applicatino Migration Operator が以降のリリースで提供されるリリースを OpenShift Container Platform 3 の以前のバージョン用に作成することによって生じます。
Migration コントローラー CR オブジェクトを作成します。
oc create -f controller-3.yml
$ oc create -f controller-3.yml
Copy to Clipboard Copied! Velero および Restic Pod が実行されていることを確認します。
oc get pods -n openshift-migration
$ oc get pods -n openshift-migration
Copy to Clipboard Copied!
1.4.2. 制限された環境での Cluster Application Migration Operator のインストール
Cluster Application Migration Operator は Operator Lifecycle Manager (OLM) で OpenShift Container Platform 4.3 ターゲットクラスターにインストールすることも、手動で OpenShift Container Platform 3 ソースクラスターにインストールすることもできます。
OpenShift Container Platform 4.3 では、カスタム Operator カタログイメージをビルドし、これをローカルミラーイメージレジストリーにプッシュし、OLM をローカルレジストリーから Cluster Application Migration Operator をインストールするように設定できます。mapping.txt
ファイルは、oc adm catalog mirror
コマンドの実行時に作成されます。
OpenShift Container Platform 3 クラスターでは、Operator イメージに基づいてマニフェストファイルを作成し、ファイルをローカルイメージレジストリーを参照するように編集できます。マニフェストファイルの image
の値は、mapping.txt
ファイルの sha256
の値を使用します。次に、ローカルイメージを使用して Cluster Application Migration Operator を作成できます。
1.4.2.1. Operator カタログイメージのビルド
クラスター管理者は、Operator Lifecycle Manager (OLM) によって使用されるカスタム Operator カタログイメージをビルドし、Docker v2-2 をサポートするコンテナーイメージレジストリーにそのイメージをプッシュできます。ネットワークが制限された環境のクラスターの場合、このレジストリーには、ネットワークが制限されたインストールで作成されたミラーレジストリーなど、クラスターにネットワークアクセスのあるレジストリーを使用できます。
OpenShift Container Platform クラスターの内部レジストリーはターゲットレジストリーとして使用できません。これは、ミラーリングプロセスで必要となるタグを使わないプッシュをサポートしないためです。
以下の例では、お使いのネットワークとインターネットの両方にアクセスできるミラーレジストリーを使用することを前提としています。
前提条件
- ネットワークアクセスが無制限の Linux ワークステーション
-
oc
version 4.3.5+ -
podman
version 1.4.4+ - Docker v2-2 をサポートするミラーレジストリーへのアクセス
プライベートレジストリーを使用している場合、後続の手順で使用するために
REG_CREDS
環境変数をレジストリー認証情報のファイルパスに設定します。たとえばpodman
CLI の場合は、以下のようになります。REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
$ REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
Copy to Clipboard Copied! quay.io アカウントがアクセスできるプライベート namespace を使用している場合、Quay 認証トークンを設定する必要があります。quay.io 認証情報を使用してログイン API に対して要求を行うことにより、
--auth-token
フラグで使用できるAUTH_TOKEN
環境変数を設定します。AUTH_TOKEN=$(curl -sH "Content-Type: application/json" \ -XPOST https://quay.io/cnr/api/v1/users/login -d '
$ AUTH_TOKEN=$(curl -sH "Content-Type: application/json" \ -XPOST https://quay.io/cnr/api/v1/users/login -d ' { "user": { "username": "'"<quay_username>"'", "password": "'"<quay_password>"'" } }' | jq -r '.token')
Copy to Clipboard Copied!
手順
ネットワークアクセスが無制限のワークステーションで、ターゲットミラーレジストリーを使用して認証を行います。
podman login <registry_host_name>
$ podman login <registry_host_name>
Copy to Clipboard Copied! また、ビルド時にベースイメージをプルできるように、
registry.redhat.io
で認証します。podman login registry.redhat.io
$ podman login registry.redhat.io
Copy to Clipboard Copied! quay.ioから
redhat-operators
カタログをベースにカタログイメージをビルドし、そのイメージにタグを付け、ミラーレジストリーにプッシュします。oc adm catalog build \ --appregistry-org redhat-operators \ --appregistry-org redhat-operators \ --from=registry.redhat.io/openshift4/ose-operator-registry:v4.3 \ --from=registry.redhat.io/openshift4/ose-operator-registry:v4.3 \ --filter-by-os="linux/amd64" \ --filter-by-os="linux/amd64" \ --to=<registry_host_name>:<port>/olm/redhat-operators:v1 \ --to=<registry_host_name>:<port>/olm/redhat-operators:v1 \ [-a ${REG_CREDS}] \ [-a ${REG_CREDS}] \ [--insecure] \ [--insecure] \ [--auth-token "${AUTH_TOKEN}"] [--auth-token "${AUTH_TOKEN}"] INFO[0013] loading Bundles dir=/var/folders/st/9cskxqs53ll3wdn434vw4cd80000gn/T/300666084/manifests-829192605 ... Pushed sha256:f73d42950021f9240389f99ddc5b0c7f1b533c054ba344654ff1edaf6bf827e3 to example_registry:5000/olm/redhat-operators:v1
$ oc adm catalog build \ --appregistry-org redhat-operators \
1 --from=registry.redhat.io/openshift4/ose-operator-registry:v4.3 \
2 --filter-by-os="linux/amd64" \
3 --to=<registry_host_name>:<port>/olm/redhat-operators:v1 \
4 [-a ${REG_CREDS}] \
5 [--insecure] \
6 [--auth-token "${AUTH_TOKEN}"]
7 INFO[0013] loading Bundles dir=/var/folders/st/9cskxqs53ll3wdn434vw4cd80000gn/T/300666084/manifests-829192605 ... Pushed sha256:f73d42950021f9240389f99ddc5b0c7f1b533c054ba344654ff1edaf6bf827e3 to example_registry:5000/olm/redhat-operators:v1
Copy to Clipboard Copied! - 1
- App Registry インスタンスからのプルに使用する組織 (namespace)。
- 2
- ターゲット OpenShift Container Platform クラスターのメジャーバージョンおよびマイナーバージョンに一致するタグを使用して、
--from
をose-operator-registry
ベースイメージに設定します。 - 3
--filter-by-os
を、ターゲットの OpenShift Container Platform クラスターと一致する必要のある、ベースイメージに使用するオペレーティングシステムおよびアーキテクチャーに設定します。使用できる値は、linux/amd64
、linux/ppc64le
、およびlinux/s390x
です。- 4
- カタログイメージに名前を付け、
v1
などのタグを追加します。 - 5
- オプション: 必要な場合は、レジストリー認証情報ファイルの場所を指定します。
- 6
- オプション: ターゲットレジストリーの信頼を設定しない場合は、
--insecure
フラグを追加します。 - 7
- オプション: 公開されていない他のアプリケーションレジストリーカタログが使用されている場合、Quay 認証トークンを指定します。
無効なマニフェストが Red Hat のカタログに誤って導入される可能性があります。これが実際に生じる場合には、以下のようなエラーが表示される可能性があります。
... INFO[0014] directory dir=/var/folders/st/9cskxqs53ll3wdn434vw4cd80000gn/T/300666084/manifests-829192605 file=4.2 load=package W1114 19:42:37.876180 34665 builder.go:141] error building database: error loading package into db: fuse-camel-k-operator.v7.5.0 specifies replacement that couldn't be found Uploading ... 244.9kB/s
... INFO[0014] directory dir=/var/folders/st/9cskxqs53ll3wdn434vw4cd80000gn/T/300666084/manifests-829192605 file=4.2 load=package W1114 19:42:37.876180 34665 builder.go:141] error building database: error loading package into db: fuse-camel-k-operator.v7.5.0 specifies replacement that couldn't be found Uploading ... 244.9kB/s
Copy to Clipboard Copied! 通常、これらのエラーは致命的なエラーではなく、該当する Operator パッケージにインストールする予定の Operator やその依存関係が含まれない場合、それらを無視することができます。
1.4.2.2. ネットワークが制限された環境向けの OperatorHub の設定
クラスター管理者は、カスタム Operator カタログイメージを使用し、OLM および OperatorHub をネットワークが制限された環境でローカルコンテンツを使用するように設定できます。この例では、以前にビルドされ、サポートされているレジストリーにプッシュされたカスタム redhat-operators
カタログイメージを使用します。
前提条件
- ネットワークアクセスが無制限の Linux ワークステーション
- サポートされているレジストリーにプッシュされるカスタム Operator カタログイメージ
-
oc
version 4.3.5+ -
podman
version 1.4.4+ - Docker v2-2 をサポートするミラーレジストリーへのアクセス
プライベートレジストリーを使用している場合、後続の手順で使用するために
REG_CREDS
環境変数をレジストリー認証情報のファイルパスに設定します。たとえばpodman
CLI の場合は、以下のようになります。REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
$ REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json
Copy to Clipboard Copied!
手順
disableAllDefaultSources: true
を仕様に追加してデフォルトの OperatorSource を無効にします。oc patch OperatorHub cluster --type json \ -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
$ oc patch OperatorHub cluster --type json \ -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
Copy to Clipboard Copied! これにより、OpenShift Container Platform のインストール時にデフォルトで設定されるデフォルトの OperatorSource が無効になります。
oc adm catalog mirror
コマンドは、カスタム Operator カタログイメージのコンテンツを抽出し、ミラーリングに必要なマニフェストを生成します。以下のいずれかを選択できます。- コマンドのデフォルト動作で、マニフェストの生成後にすべてのイメージコンテンツをミラーレジストリーに自動的にミラーリングできるようにします。または、
-
--manifests-only
フラグを追加して、ミラーリングに必要なマニフェストのみを生成しますが、これにより、イメージコンテンツがレジストリーに自動的にミラーリングされる訳ではありません。これは、ミラーリングする内容を確認するのに役立ちます。また、コンテンツのサブセットのみが必要な場合に、マッピングの一覧に変更を加えることができます。次に、そのファイルをoc image mirror
コマンドで使用し、後のステップでイメージの変更済みの一覧をミラーリングできます。
ネットワークアクセスが無制限のワークステーションで、以下のコマンドを実行します。
oc adm catalog mirror \ <registry_host_name>:<port>/olm/redhat-operators:v1 \ <registry_host_name>:<port>/olm/redhat-operators:v1 \ <registry_host_name>:<port> \ <registry_host_name>:<port> \ [-a ${REG_CREDS}] \ [-a ${REG_CREDS}] \ [--insecure] \ [--insecure] \ [--filter-by-os="<os>/<arch>"] \ [--filter-by-os="<os>/<arch>"] \ [--manifests-only] [--manifests-only]
$ oc adm catalog mirror \ <registry_host_name>:<port>/olm/redhat-operators:v1 \
1 <registry_host_name>:<port> \ [-a ${REG_CREDS}] \
2 [--insecure] \
3 [--filter-by-os="<os>/<arch>"] \
4 [--manifests-only]
5 Copy to Clipboard Copied! - 1
- Operator カタログイメージを指定します。
- 2
- オプション: 必要な場合は、レジストリー認証情報ファイルの場所を指定します。
- 3
- オプション: ターゲットレジストリーの信頼を設定しない場合は、
--insecure
フラグを追加します。 - 4
- オプション: カタログは複数のアーキテクチャーおよびオペレーティングシステムをサポートするイメージを参照する可能性があるため、アーキテクチャーおよびオペレーティングシステムでフィルターして、一 致するイメージのみをミラーリングするようにできます。使用できる値は、
linux/amd64
、linux/ppc64le
、およびlinux/s390x
です。 - 5
- オプション: ミラーリングに必要なマニフェストのみを生成し、実際にはイメージコンテンツをレジストリーにミラーリングしません。
出力例
using database path mapping: /:/tmp/190214037 wrote database to /tmp/190214037 using database at: /tmp/190214037/bundles.db ...
using database path mapping: /:/tmp/190214037 wrote database to /tmp/190214037 using database at: /tmp/190214037/bundles.db
1 ...
Copy to Clipboard Copied! - 1
- コマンドで生成される一時的なデータベース。
コマンドの実行後に、
<image_name>-manifests/
ディレクトリーが現在のディレクトリーに作成され、以下のファイルが生成されます。-
これにより、
imageContentSourcePolicy.yaml
ファイルは ImageContentSourcePolicy オブジェクトを定義します。このオブジェクトは、このオブジェクトは、ノードを Operator マニフェストおよびミラーリングされたレジストリーに保存されるイメージ参照間で変換できるように設定します。 -
mapping.txt
ファイルには、すべてのソースイメージが含まれ、これはそれらのイメージをターゲットレジストリー内のどこにマップするかを示します。このファイルはoc image mirror
コマンドと互換性があり、ミラーリング設定をさらにカスタマイズするために使用できます。
直前の手順で
--manifests-only
フラグを使用して、コンテンツのサブセットのみをミラーリングする場合は、以下を実行します。mapping.txt
ファイルのイメージの一覧を仕様に変更します。ミラーリングするイメージのサブセットの名前とバージョンが不明な場合は、以下の手順で確認します。oc adm catalog mirror
コマンドで生成された一時的なデータベースに対してsqlite3
ツールを実行し、一般的な検索クエリーに一致するイメージの一覧を取得します。出力は、後にmapping.txt
ファイルを編集する方法を通知するのに役立ちます。たとえば、
clusterlogging.4.3
の文字列のようなイメージの一覧を取得するには、以下を実行します。echo "select * from related_image \ where operatorbundle_name like 'clusterlogging.4.3%';" \ | sqlite3 -line /tmp/190214037/bundles.db
$ echo "select * from related_image \ where operatorbundle_name like 'clusterlogging.4.3%';" \ | sqlite3 -line /tmp/190214037/bundles.db
1 Copy to Clipboard Copied! - 1
oc adm catalog mirror
コマンドの直前の出力を参照し、データベースファイルのパスを見つけます。
出力例
image = registry.redhat.io/openshift4/ose-logging-kibana5@sha256:aa4a8b2a00836d0e28aa6497ad90a3c116f135f382d8211e3c55f34fb36dfe61 operatorbundle_name = clusterlogging.4.3.33-202008111029.p0 image = registry.redhat.io/openshift4/ose-oauth-proxy@sha256:6b4db07f6e6c962fc96473d86c44532c93b146bbefe311d0c348117bf759c506 operatorbundle_name = clusterlogging.4.3.33-202008111029.p0 ...
image = registry.redhat.io/openshift4/ose-logging-kibana5@sha256:aa4a8b2a00836d0e28aa6497ad90a3c116f135f382d8211e3c55f34fb36dfe61 operatorbundle_name = clusterlogging.4.3.33-202008111029.p0 image = registry.redhat.io/openshift4/ose-oauth-proxy@sha256:6b4db07f6e6c962fc96473d86c44532c93b146bbefe311d0c348117bf759c506 operatorbundle_name = clusterlogging.4.3.33-202008111029.p0 ...
Copy to Clipboard Copied! 直前の手順で取得した結果を使用して
mapping.txt
ファイルを編集し、ミラーリングする必要のあるイメージのサブセットのみを追加します。たとえば、前述の出力例の
image
値を使用して、mapping.txt
ファイルに以下の一致する行が存在することを確認できます。mapping.txt
の一致するイメージマッピング。registry.redhat.io/openshift4/ose-logging-kibana5@sha256:aa4a8b2a00836d0e28aa6497ad90a3c116f135f382d8211e3c55f34fb36dfe61=<registry_host_name>:<port>/openshift4-ose-logging-kibana5:a767c8f0 registry.redhat.io/openshift4/ose-oauth-proxy@sha256:6b4db07f6e6c962fc96473d86c44532c93b146bbefe311d0c348117bf759c506=<registry_host_name>:<port>/openshift4-ose-oauth-proxy:3754ea2b
registry.redhat.io/openshift4/ose-logging-kibana5@sha256:aa4a8b2a00836d0e28aa6497ad90a3c116f135f382d8211e3c55f34fb36dfe61=<registry_host_name>:<port>/openshift4-ose-logging-kibana5:a767c8f0 registry.redhat.io/openshift4/ose-oauth-proxy@sha256:6b4db07f6e6c962fc96473d86c44532c93b146bbefe311d0c348117bf759c506=<registry_host_name>:<port>/openshift4-ose-oauth-proxy:3754ea2b
Copy to Clipboard Copied! この例では、これらのイメージのみをミラーリングする場合に、
mapping.txt
ファイルの他のすべてのエントリーを削除し、上記の 2 行のみを残します。
ネットワークアクセスが無制限のワークステーション上で、変更した
mapping.txt
ファイルを使用し、oc image mirror
コマンドを使用してイメージをレジストリーにミラーリングします。oc image mirror \ [-a ${REG_CREDS}] \ -f ./redhat-operators-manifests/mapping.txt
$ oc image mirror \ [-a ${REG_CREDS}] \ -f ./redhat-operators-manifests/mapping.txt
Copy to Clipboard Copied!
ImageContentSourcePolicy を適用します。
oc apply -f ./redhat-operators-manifests/imageContentSourcePolicy.yaml
$ oc apply -f ./redhat-operators-manifests/imageContentSourcePolicy.yaml
Copy to Clipboard Copied! カタログイメージを参照する CatalogSource オブジェクトを作成します。
仕様を以下のように変更し、これを
catalogsource.yaml
ファイルとして保存します。apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: my-operator-catalog namespace: openshift-marketplace spec: sourceType: grpc image: <registry_host_name>:<port>/olm/redhat-operators:v1 displayName: My Operator Catalog publisher: grpc
apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: my-operator-catalog namespace: openshift-marketplace spec: sourceType: grpc image: <registry_host_name>:<port>/olm/redhat-operators:v1
1 displayName: My Operator Catalog publisher: grpc
Copy to Clipboard Copied! - 1
- Operator カタログイメージを指定します。
このファイルを使用して CatalogSource オブジェクトを作成します。
oc create -f catalogsource.yaml
$ oc create -f catalogsource.yaml
Copy to Clipboard Copied!
以下のリソースが正常に作成されていることを確認します。
Pod を確認します。
oc get pods -n openshift-marketplace
$ oc get pods -n openshift-marketplace
Copy to Clipboard Copied! 出力例
NAME READY STATUS RESTARTS AGE my-operator-catalog-6njx6 1/1 Running 0 28s marketplace-operator-d9f549946-96sgr 1/1 Running 0 26h
NAME READY STATUS RESTARTS AGE my-operator-catalog-6njx6 1/1 Running 0 28s marketplace-operator-d9f549946-96sgr 1/1 Running 0 26h
Copy to Clipboard Copied! CatalogSource を確認します。
oc get catalogsource -n openshift-marketplace
$ oc get catalogsource -n openshift-marketplace
Copy to Clipboard Copied! 出力例
NAME DISPLAY TYPE PUBLISHER AGE my-operator-catalog My Operator Catalog grpc 5s
NAME DISPLAY TYPE PUBLISHER AGE my-operator-catalog My Operator Catalog grpc 5s
Copy to Clipboard Copied! PackageManifest を確認します。
oc get packagemanifest -n openshift-marketplace
$ oc get packagemanifest -n openshift-marketplace
Copy to Clipboard Copied! 出力例
NAME CATALOG AGE etcd My Operator Catalog 34s
NAME CATALOG AGE etcd My Operator Catalog 34s
Copy to Clipboard Copied!
ネットワークが制限された環境の OpenShift Container Platform クラスター Web コンソールで、OperatorHub ページから Operator をインストールできます。
1.4.2.3. 制限された環境での Cluster Application Migration Operator の OpenShift Container Platform 4.3 ターゲットクラスターへのインストール
Operator Lifecycle Manager (OLM) を使用して OpenShift Container Platform 4.3 ターゲットクラスターに Cluster Application Migration Operator をインストールできます。
Cluster Application Migration Operator は、デフォルトで Cluster Application Migration ツールをターゲットクラスターにインストールします。
前提条件
- カスタム Operator カタログを作成し、これをミラーレジストリーにプッシュしていること。
- ミラーレジストリーから Cluster Application Migration Operator をインストールするように OLM を設定していること。
手順
-
OpenShift Container Platform Web コンソールで、Operators
OperatorHub をクリックします。 -
Filter by keyword フィールド (この場合は
Migration
) を使用して Cluster Application Migration Operator を見つけます。 - Cluster Application Migration Operator を選択し、Install をクリックします。
-
Create Operator Subscription ページで
openshift-migration
namespace を選択し、承認ストラテジーを指定します。 Subscribe をクリックします。
Installed Operators ページで、Cluster Application Migration Operator は、InstallSucceeded のステータスで openshift-migration プロジェクトに表示されます。
- Provided APIs の下で、View 12 more… をクリックします。
-
Create New
MigrationController をクリックします。 - Create をクリックします。
-
Workloads
Pods をクリックし、Controller Manager、Migration UI、Restic、および Velero Pod が実行中であることを確認します。
1.4.2.4. 制限された環境での Cluster Application Migration Operator の OpenShift Container Platform 3 ソースクラスターへのインストール
Cluster Application Migration Operator イメージに基づいてマニフェストファイルを作成し、マニフェストを編集してローカルイメージレジストリーを参照できます。次に、ローカルイメージを使用して Cluster Application Migration Operator を OpenShift Container Platform 3 ソースクラスターに作成できます。
前提条件
-
registry.redhat.io
へのアクセス - ネットワークアクセスが無制限の Linux ワークステーション
- Docker v2-2 をサポートするミラーレジストリー
- ミラーレジストリーにプッシュされるカスタム Operator カタログ
手順
ネットワークアクセスが無制限のワークステーションで、Red Hat カスタマーポータルの認証情報を使用して
registry.redhat.io
にログインします。sudo podman login registry.redhat.io
$ sudo podman login registry.redhat.io
Copy to Clipboard Copied! 注記システムがルートレス Podman コンテナー用に設定されている場合は、この手順に
sudo
は必要ありません。operator.yml
ファイルをダウンロードします。sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/operator.yml ./
$ sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/operator.yml ./
Copy to Clipboard Copied! controller-3.yml
ファイルをダウンロードします。sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/controller-3.yml ./
$ sudo podman cp $(sudo podman create registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator:v1.2):/controller-3.yml ./
Copy to Clipboard Copied! OpenShift Container Platform 4 クラスターで
oc adm catalog mirror
の実行時に作成されたmapping.txt
ファイルから Operator イメージの値を取得します。grep openshift-migration-rhel7-operator ./mapping.txt | grep rhcam-1-2
$ grep openshift-migration-rhel7-operator ./mapping.txt | grep rhcam-1-2
Copy to Clipboard Copied! 出力には、
registry.redhat.io
イメージとミラーレジストリーイメージ間のマッピングが表示されます。registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator@sha256:468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a=<registry.apps.example.com>/rhcam-1-2/openshift-migration-rhel7-operator
registry.redhat.io/rhcam-1-2/openshift-migration-rhel7-operator@sha256:468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a=<registry.apps.example.com>/rhcam-1-2/openshift-migration-rhel7-operator
Copy to Clipboard Copied! operator.yml
ファイルのimage
およびREGISTRY
の値を更新します。containers: - name: ansible image: <registry.apps.example.com>/rhcam-1-2/openshift-migration-rhel7-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a> ... - name: operator image: <registry.apps.example.com>/rhcam-1-2/openshift-migration-rhel7-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a> ... env: - name: REGISTRY value: <registry.apps.example.com>
containers: - name: ansible image: <registry.apps.example.com>/rhcam-1-2/openshift-migration-rhel7-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a>
1 ... - name: operator image: <registry.apps.example.com>/rhcam-1-2/openshift-migration-rhel7-operator@sha256:<468a6126f73b1ee12085ca53a312d1f96ef5a2ca03442bcb63724af5e2614e8a>
2 ... env: - name: REGISTRY value: <registry.apps.example.com>
3 Copy to Clipboard Copied! - OpenShift Container Platform 3 クラスターにログインします。
Cluster Application Migration Operator CR オブジェクトを作成します。
oc create -f operator.yml
$ oc create -f operator.yml
Copy to Clipboard Copied! 出力は以下のようになります。
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 Error from server (AlreadyExists): error when creating "./operator.yml": rolebindings.rbac.authorization.k8s.io "system:image-pullers" already exists
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
Copy to Clipboard Copied! - 1
Error from server (AlreadyExists)
メッセージは無視できます。これらは、Cluster Applicatino Migration Operator が以降のリリースで提供されるリリースを OpenShift Container Platform 3 の以前のバージョン用に作成することによって生じます。
Migration コントローラー CR オブジェクトを作成します。
oc create -f controller-3.yml
$ oc create -f controller-3.yml
Copy to Clipboard Copied! Velero および Restic Pod が実行されていることを確認します。
oc get pods -n openshift-migration
$ oc get pods -n openshift-migration
Copy to Clipboard Copied!
1.4.3. CAM Web コンソールの起動
ブラウザーで CAM Web コンソールを起動できます。
手順
- CAM ツールがインストールされている OpenShift Container Platform クラスターにログインします。
以下のコマンドを入力して CAM Web コンソール URL を取得します。
oc get -n openshift-migration route/migration -o go-template='https://{{ .spec.host }}'
$ oc get -n openshift-migration route/migration -o go-template='https://{{ .spec.host }}'
Copy to Clipboard Copied! 出力は
https://migration-openshift-migration.apps.cluster.openshift.com
のようになります。ブラウザーを起動し、CAM Web コンソールに移動します。
注記Cluster Application Migration Operator のインストール後すぐに CAM Web コンソールにアクセスしようとする場合、Operator は依然としてクラスターを設定しているため、コンソールが読み込まれないことがあります。数分待機した後に再試行します。
- 自己署名 CA 証明書を使用している場合、ソースクラスターの API サーバーの CA 証明書を受け入れることを求めるプロンプトが出されます。Web ページは、残りの証明書を受け入れるプロセスについて説明します。
- OpenShift Container Platform の ユーザー名 および パスワード を使用してログインします。