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.3.3. 部署集群应用程序迁移 (CAM) 工具
部署集群应用程序迁移 (CAM) 工具需要在 OpenShift Container Platform 4.2 源和 OpenShift Container Platform 4.2 目标集群上安装 CAM Operator。 并在OpenShift Container Platform 4.2 源集群中配置跨原始资源共享。
Cluster Application Migration Operator 默认在目标集群上安装 CAM 工具(CAM web 控制台和迁移控制器)。您可以 在 OpenShift Container Platform 3 和远程集群中安装 CAM 工具。
您可以使用 OLM 在 OpenShift Container Platform 4.2 源集群上安装 Cluster Application Migration Operator。
流程
-
在 OpenShift Container Platform Web 控制台中,点击 Operators
OperatorHub。 -
使用 Filter by keyword 项(在这里是
Migration
)找到 Cluster Application Migration Operator。 - 选择 Cluster Application Migration Operator 并点 Install。
-
在 Create Operator Subscription 页面中,选择
openshift-migration
命名空间,并指定批准策略。 点 Subscribe。
在 Installed Operators 页中,Cluster Application Migration Operator 会出现在 openshift-migration 项目中,其状态为 InstallSucceeded。
- 在 Provided APIs 中点 View 12 more….
-
点 Create New
MigrationController。 在
spec
小节中更新migration_controller
和 migration_uispec: [...] migration_controller: false migration_ui: false [...]
spec: [...] migration_controller: false migration_ui: false [...]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 点击 Create。
-
点 Workloads
Pod 来验证 Restic 和 Velero Pod 是否正在运行。
您可以使用 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
命名空间,并指定批准策略。 点 Subscribe。
在 Installed Operators 页中,Cluster Application Migration Operator 会出现在 openshift-migration 项目中,其状态为 InstallSucceeded。
- 在 Provided APIs 中点 View 12 more….
-
点 Create New
MigrationController。 - 点击 Create。
-
点 Workloads
Pod 来验证 Controller Manager 、Migration UI 、Restic 和 Velero Pod 是否正在运行。
3.3.3. 在 OpenShift Container Platform 4.2 源集群中配置跨原始资源共享 复制链接链接已复制到粘贴板!
您必须在 OpenShift Container Platform 4.2 源集群中配置跨原始资源共享,以启用源集群 API 服务器和 CAM 工具之间的通信。
流程
- 登录到已安装 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 - 登录到源集群。
编辑 Kubernetes API 服务器 CR:
oc edit apiserver.config.openshift.io cluster
$ oc edit apiserver.config.openshift.io cluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 CORS 配置值添加到
spec
小节中的additionalCORSAllowedOrigins
:spec: additionalCORSAllowedOrigins: - (?i)//migration-openshift-migration\.apps\.cluster\.com(:|\z)
spec: additionalCORSAllowedOrigins: - (?i)//migration-openshift-migration\.apps\.cluster\.com(:|\z)
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- 指定您的 CORS 配置值。
- 保存文件以使改变生效。
验证配置:
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