第 7 章 访问 ROSA 集群
建议您使用身份提供程序(IDP)帐户访问 Red Hat OpenShift Service on AWS (ROSA)集群。但是,创建集群的集群管理员可以使用快速访问过程访问它。
本文档论述了如何使用 ROSA CLI (rosa
) 访问集群并设置 IDP。另外,您可以使用 OpenShift Cluster Manager 控制台创建 IDP 帐户。
7.1. 快速访问集群
您可以使用此快速访问过程来登录到集群。
注意
作为最佳实践,请使用 IDP 帐户访问集群。
流程
输入以下命令:
$ rosa create admin --cluster=<cluster_name>
输出示例
W: It is recommended to add an identity provider to login to this cluster. See 'rosa create idp --help' for more information. I: Admin account has been added to cluster 'cluster_name'. It may take up to a minute for the account to become active. I: To login, run the following command: oc login https://api.cluster-name.t6k4.i1.organization.org:6443 \1 --username cluster-admin \ --password FWGYL-2mkJI-3ZTTZ-rINns
- 1
- 对于托管 control plane (HCP)集群的 Red Hat OpenShift Service on AWS (ROSA),端口号应为
443。
在上一命令的输出中输入
oc login
命令、用户名和密码:输出示例
$ oc login https://api.cluster_name.t6k4.i1.organization.org:6443 \1 > --username cluster-admin \ > --password FWGYL-2mkJI-3ZTTZ-rINns Login successful. You have access to 77 projects, the list has been suppressed. You can list all projects with 'projects'
- 1
- 对于使用 HCP 集群的 ROSA,端口号应为
443。
使用 default 项目,输入此
oc
命令来验证是否已创建集群管理员访问权限:$ oc whoami
输出示例
cluster-admin