第 5 章 访问 ROSA 集群
建议您使用身份提供程序(IDP)帐户访问 Red Hat OpenShift Service on AWS (ROSA)集群。但是,创建集群的集群管理员可以使用快速访问过程访问它。
本文档论述了如何使用 ROSA CLI (rosa) 访问集群并设置 IDP。另外,您可以使用 OpenShift Cluster Manager 控制台创建 IDP 帐户。
5.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.oragnization.org:6443 \ --username cluster-admin \ --password FWGYL-2mkJI-3ZTTZ-rINns
在上一命令的输出中输入
oc login命令、用户名和密码:输出示例
$ oc login https://api.cluster_name.t6k4.i1.oragnization.org:6443 \ > --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'
使用 default 项目,输入此
oc命令来验证是否已创建集群管理员访问权限:$ oc whoami
输出示例
cluster-admin