2.3. 使用 OpenShift Cluster Manager 的要求
只有在使用 OpenShift Cluster Manager 管理集群时才需要以下配置详情。如果您只使用 CLI 工具,则可以忽略这些要求。
2.3.1. AWS 帐户关联 复制链接链接已复制到粘贴板!
当使用 OpenShift Cluster Manager (console.redhat.com)置备 Red Hat OpenShift Service on AWS 时,您必须使用 Amazon Resource Name (ARN)将 ocm-role 和 user-role IAM 角色与 AWS 帐户关联。此关联过程也称为 帐户链接。
ocm-role ARN 作为标签存储在红帽机构中,而 user-role ARN 则作为红帽用户帐户中的标签存储。红帽使用这些 ARN 标签来确认用户是有效的帐户拥有者,并可使用正确的权限来执行 AWS 帐户中的置备任务。
2.3.2. 将您的 AWS 帐户与 IAM 角色关联 复制链接链接已复制到粘贴板!
您可以使用 ROSA CLI rosa 将 AWS 帐户与现有 IAM 角色关联或连接。
先决条件
- 您有一个 AWS 帐户。
- 您有安装 AWS 范围的角色所需的权限。如需更多信息,请参阅本节的"附加资源"。
-
您已在安装主机上安装和配置了最新的 AWS (
aws) 和 ROSA (rosa) CLI。 您已创建了
ocm-role和user-roleIAM 角色,但还没有将它们链接到 AWS 帐户。您可以运行以下命令来检查您的 IAM 角色是否已链接:rosa list ocm-role
$ rosa list ocm-roleCopy to Clipboard Copied! Toggle word wrap Toggle overflow rosa list user-role
$ rosa list user-roleCopy to Clipboard Copied! Toggle word wrap Toggle overflow 如果这两个角色的
Linked列中显示了Yes,您已将角色链接到 AWS 帐户。
流程
在 ROSA CLI 中,使用 Amazon 资源名称(ARN)将
ocm-role资源链接到红帽机构:注意您必须具有红帽机构管理员权限才能运行
rosa link命令。将ocm-role资源与 AWS 帐户链接后,它会生效,并对机构的所有用户可见。rosa link ocm-role --role-arn <arn>
$ rosa link ocm-role --role-arn <arn>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
I: Linking OCM role ? Link the '<AWS ACCOUNT ID>` role with organization '<ORG ID>'? Yes I: Successfully linked role-arn '<AWS ACCOUNT ID>' with organization account '<ORG ID>'
I: Linking OCM role ? Link the '<AWS ACCOUNT ID>` role with organization '<ORG ID>'? Yes I: Successfully linked role-arn '<AWS ACCOUNT ID>' with organization account '<ORG ID>'Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 ROSA CLI 中,使用 Amazon 资源名称(ARN)将您的
user-role资源链接到您的红帽用户帐户:rosa link user-role --role-arn <arn>
$ rosa link user-role --role-arn <arn>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 输出示例
I: Linking User role ? Link the 'arn:aws:iam::<ARN>:role/ManagedOpenShift-User-Role-125' role with organization '<AWS ID>'? Yes I: Successfully linked role-arn 'arn:aws:iam::<ARN>:role/ManagedOpenShift-User-Role-125' with organization account '<AWS ID>'
I: Linking User role ? Link the 'arn:aws:iam::<ARN>:role/ManagedOpenShift-User-Role-125' role with organization '<AWS ID>'? Yes I: Successfully linked role-arn 'arn:aws:iam::<ARN>:role/ManagedOpenShift-User-Role-125' with organization account '<AWS ID>'Copy to Clipboard Copied! Toggle word wrap Toggle overflow
其他资源
2.3.3. 将多个 AWS 帐户与红帽机构相关联 复制链接链接已复制到粘贴板!
您可以将多个 AWS 帐户与红帽机构相关联。通过关联多个帐户,您可以从红帽机构在任何关联的 AWS 帐户上创建 Red Hat OpenShift Service on AWS 集群。
使用此功能,您可以根据对业务有意义的特征在不同的 AWS 配置集上创建集群,例如,为每个区域使用一个 AWS 配置集来创建区域密集型环境。
先决条件
- 您有一个 AWS 帐户。
- 您可以使用 OpenShift Cluster Manager 创建集群。
- 您有安装 AWS 范围的角色所需的权限。
-
您已在安装主机上安装和配置了最新的 AWS (
aws) 和 ROSA (rosa) CLI。 -
您已为 Red Hat OpenShift Service on AWS 创建了
ocm-role和user-roleIAM 角色。
流程
要关联一个额外的 AWS 帐户,首先在本地 AWS 配置中创建配置集。然后,通过在额外的 AWS 帐户中创建 ocm-role、用户和帐户角色,将帐户与您的红帽机构相关联。
要在附加区域中创建角色,在运行 rosa create 命令时指定 --profile <aws-profile> 参数,将 <aws_profile> 替换为附加帐户配置集名称:
在创建 OpenShift Cluster Manager 角色时指定 AWS 帐户配置集:
rosa create --profile <aws_profile> ocm-role
$ rosa create --profile <aws_profile> ocm-roleCopy to Clipboard Copied! Toggle word wrap Toggle overflow 在创建用户角色时指定 AWS 帐户配置集:
rosa create --profile <aws_profile> user-role
$ rosa create --profile <aws_profile> user-roleCopy to Clipboard Copied! Toggle word wrap Toggle overflow 在创建帐户角色时指定 AWS 帐户配置集:
rosa create --profile <aws_profile> account-roles
$ rosa create --profile <aws_profile> account-rolesCopy to Clipboard Copied! Toggle word wrap Toggle overflow
如果没有指定配置集,则使用默认 AWS 配置集及其关联的 AWS 区域。