11.2. 安装多架构计算集群
具有 x86_64 或 arm64 control plane 的集群可以支持两个不同的 CPU 架构的 worker 节点。多架构集群组合了每个架构的优势并支持各种工作负载。
例如,您可以将 arm64、IBM Power®(ppc64le)或 IBM Z®(s390x) worker 节点添加到带有 x86_64 的现有 OpenShift Container Platform 集群中。
安装的主要步骤如下:
- 创建并注册多架构计算集群。
-
创建
x86_64或arm64基础架构环境,下载用于环境的 ISO 发现镜像,并添加 control plane。arm64基础架构环境仅适用于 Amazon Web Services (AWS)和 Google Cloud (GC)。 -
创建
、arm64ppc64le或s390x基础架构环境,下载 arm64、ppc64le或s390x的 ISO 发现镜像,并添加 worker 节点。
支持的平台
有关每个 OpenShift Container Platform 版本支持的平台 ,请参阅关于带有多架构计算机器的 集群。对您安装的版本使用合适的平台。
主要步骤
- 启动使用 API 安装 OpenShift Container Platform 的流程。详情请参阅 其它资源 部分中的 使用辅助安装程序 API 安装。
当您到达安装的 Registering a new cluster step 时,将集群注册为多架构计算集群:
$ curl -s -X POST https://api.openshift.com/api/assisted-install/v2/clusters \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -d "$(jq --null-input \ --slurpfile pull_secret ~/Downloads/pull-secret.txt ' { "name": "testcluster", "openshift_version": "<version-number>-multi", "cpu_architecture" : "multi" "control_plane_count": "<number>" "base_dns_domain": "example.com", "pull_secret": $pull_secret[0] | tojson } ')" | jq '.id'-
将
multi-选项用于openshift-version;例如,"4.20-multi"。 -
将
cpu_architecture设置为"multi"。 -
将
control_plane_count设置为"3","4", 或"5"。OpenShift Container Platform 4.18 及更新的版本提供了 4 或 5 个 control plane 节点的选项。多架构计算集群不支持单节点 OpenShift。control_plane_count字段替换high_availability_mode,它已被弃用。
-
将
当您到达安装 的新基础架构环境 步骤时,将
cpu_architecture设置为"x86_64":$ curl https://api.openshift.com/api/assisted-install/v2/infra-envs \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -d "$(jq --null-input \ --slurpfile pull_secret ~/Downloads/pull-secret.txt \ --arg cluster_id ${CLUSTER_ID} ' { "name": "testcluster-infra-env", "image_type":"full-iso", "cluster_id": $cluster_id, "cpu_architecture" : "x86_64" "pull_secret": $pull_secret[0] | tojson } ')" | jq '.id'当您到达安装的 Adding hosts 步骤时,将
host_role设置为"master":注意如需更多信息,请参阅 其它资源 中的 将角色分配给主机。
$ curl https://api.openshift.com/api/assisted-install/v2/infra-envs/${INFRA_ENV_ID}/hosts/<host_id> \ -X PATCH \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -d ' { "host_role":"master" } ' | jq-
下载
x86_64架构的发现镜像。 -
使用生成的发现镜像引导
x86_64架构主机。 - 开始安装,并等待集群完全安装好。
重复安装的新基础架构环境 步骤。这一次,将
cpu_architecture设置为以下之一:"ppc64le"(用于 IBM Power7)、"s390x" (用于 IBM Z®),或"arm64"。例如:$ curl -s -X POST https://api.openshift.com/api/assisted-install/v2/clusters \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -d "$(jq --null-input \ --slurpfile pull_secret ~/Downloads/pull-secret.txt ' { "name": "testcluster", "openshift_version": "4.12", "cpu_architecture" : "arm64" "control_plane_count": "3" "base_dns_domain": "example.com", "pull_secret": $pull_secret[0] | tojson } ')" | jq '.id'重复安装 添加主机 步骤。这一次,将
host_role设置为"worker":注意如需了解更多详细信息,请参阅 其它资源 中的 将角色分配给主机。
$ curl https://api.openshift.com/api/assisted-install/v2/infra-envs/${INFRA_ENV_ID}/hosts/<host_id> \ -X PATCH \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -d ' { "host_role":"worker" } ' | jq- 下载 arm64、ppc64le 或 s390x 架构的发现镜像。
- 使用生成的发现镜像引导架构主机。
- 开始安装,并等待集群完全安装好。
验证
运行以下命令,查看集群中的 arm64、ppc64le 或 s390x worker 节点:
$ oc get nodes -o wide