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.5. Cluster Application Migration (CAM) ツールのデプロイ
Cluster Application Migration (CAM) ツールをデプロイするには、Cluster Application Migration Operator を OpenShift Container Platform 3 ソース と OpenShift Container Platform 4.2 ターゲットクラスターにインストールし、 OpenShift Container Platform 3 ソースクラスターでクロスオリジンリソース共有を設定する必要があります。
Cluster Application Migration Operator はデフォルトで CAM ツール(CAM Web コンソールおよび Migration コントローラー)をターゲットクラスターにインストールします。CAM ツールは OpenShift Container Platform 3 およびリモートクラスターにインストールできます。
1.5.1. OpenShift Container Platform 3 ソースクラスターへの Cluster Application Migration Operator のインストール リンクのコピーリンクがクリップボードにコピーされました!
OpenShift Container Platform 3 は Operator Lifecycle Manager をサポートしないため、Cluster Application Migration Operator は OpenShift Container Platform 3 ソースクラスターに手動でインストールできます。
前提条件
-
podman
がインストールされていること。 OpenShift Container Platform 3 クラスターは、イメージを registry.redhat.io からプルするように設定される必要があります。
イメージをプルするには、
imagestreamsecret
を作成 し、これをクラスター内の各ノードにコピーする必要があります。
手順
Red Hat カスタマーポータルの認証情報を使用して registry.redhat.io にログインします。
sudo podman login registry.redhat.io
$ sudo podman login registry.redhat.io
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注記システムがルートレス 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! Toggle word wrap Toggle overflow 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! Toggle word wrap Toggle overflow - 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! Toggle word wrap Toggle overflow Cluster Application Migration Operator CR オブジェクトを作成します。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Migration コントローラー CR オブジェクトを作成します。
oc create -f controller-3.yml
$ oc create -f controller-3.yml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Velero および Restic Pod が実行されていることを確認します。
oc get pods -n openshift-migration
$ oc get pods -n openshift-migration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.5.2. OpenShift Container Platform 4.2 ターゲットクラスターへのクラスターアプリケーション移行 Operator のインストール リンクのコピーリンクがクリップボードにコピーされました!
OLM を使用して OpenShift Container Platform 4.2 ターゲットクラスターに Cluster Application Migration Operator をインストールできます。
Cluster Application Migration Operator は、デフォルトで CAM ツールをターゲットクラスターにインストールします。
手順
-
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.5.3. OpenShift Container Platform 3 ソースクラスターでのクロスオリジンリソース共有の設定 リンクのコピーリンクがクリップボードにコピーされました!
ソースクラスターの API サーバーと CAM ツール間の通信を有効にするために、OpenShift Container Platform 3 ソースクラスターでクロスオリジンリソース共有を設定する必要があります。
手順
- CAM ツールがインストールされているクラスターにログインします。
CORS 設定の値を取得します。
oc get -n openshift-migration route/migration -o go-template='(?i)//{{ .spec.host }}(:|\z){{ println }}' | sed 's,\.,\\.,g'
$ oc get -n openshift-migration route/migration -o go-template='(?i)//{{ .spec.host }}(:|\z){{ println }}' | sed 's,\.,\\.,g'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - OpenShift Container Platform 3 ソースクラスターにログインします。
CORS 設定値を、
/etc/origin/master/master-config.yaml
設定ファイルのcorsAllowedOrigins
スタンザに追加します。corsAllowedOrigins: - (?i)//migration-openshift-migration\.apps\.cluster\.com(:|\z) - (?i)//openshift\.default\.svc(:|\z) - (?i)//kubernetes\.default(:|\z)
corsAllowedOrigins: - (?i)//migration-openshift-migration\.apps\.cluster\.com(:|\z)
1 - (?i)//openshift\.default\.svc(:|\z) - (?i)//kubernetes\.default(:|\z)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- CORS 設定を指定します。
API サーバーおよびコントローラーマネージャーを再起動して変更を適用します。
OpenShift Container Platform 3.7 および 3.9 では、これらのコンポーネントは
systemd
で管理されるスタンドアロンのホストプロセスとして実行され、以下のコマンドを実行して再起動します。systemctl restart atomic-openshift-master-api atomic-openshift-master-controllers
$ systemctl restart atomic-openshift-master-api atomic-openshift-master-controllers
Copy to Clipboard Copied! Toggle word wrap Toggle overflow OpenShift Container Platform 3.10 および 3.11 では、これらのコンポーネントは kubelet によって管理される静的 Pod で実行され、以下のコマンドを実行して再起動します。
/usr/local/bin/master-restart api /usr/local/bin/master-restart controllers
$ /usr/local/bin/master-restart api $ /usr/local/bin/master-restart controllers
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
設定を確認します。
curl -v -k -X OPTIONS \ "<cluster_url>/apis/migration.openshift.io/v1alpha1/namespaces/openshift-migration/migclusters" \ -H "Access-Control-Request-Method: GET" \ -H "Access-Control-Request-Headers: authorization" \ -H "Origin: https://<CAM_web_console_url>"
$ curl -v -k -X OPTIONS \ "<cluster_url>/apis/migration.openshift.io/v1alpha1/namespaces/openshift-migration/migclusters" \
1 -H "Access-Control-Request-Method: GET" \ -H "Access-Control-Request-Headers: authorization" \ -H "Origin: https://<CAM_web_console_url>"
2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow 以下のような出力が表示されます。
Copy to Clipboard Copied! Toggle word wrap Toggle overflow