1.2. 管理ユーザーの作成
管理 (admin) ユーザーを作成すると、クラスターにすばやくアクセスできるようになります。管理ユーザーを作成するには、次の手順に従います。
管理ユーザーは、このチュートリアル設定では問題なく機能します。実際のデプロイメントでは、正式なアイデンティティープロバイダー を使用してクラスターにアクセスし、ユーザーに管理権限を付与してください。
1.2.1. CLI を使用して管理者ユーザーを作成する リンクのコピーリンクがクリップボードにコピーされました!
次のコマンドを実行して管理ユーザーを作成します。
$ 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 'my-rosa-cluster'. It may take up to a minute for the account to become active. I: To login, run the following command: oc login https://api.my-rosa-cluster.abcd.p1.openshiftapps.com:6443 \ --username cluster-admin \ --password FWGYL-2mkJI-00000-00000前のステップで返されたログインコマンドをコピーし、ターミナルに貼り付けます。これにより、CLI を使用してクラスターにログインし、クラスターの使用を開始できるようになります。
$ oc login https://api.my-rosa-cluster.abcd.p1.openshiftapps.com:6443 \ > --username cluster-admin \ > --password FWGYL-2mkJI-00000-00000出力例
Login successful. You have access to 79 projects, the list has been suppressed. You can list all projects with ' projects' Using project "default".管理ユーザーとしてログインしていることを確認するには、次のコマンドのいずれかを実行します。
オプション 1:
$ oc whoami出力例
cluster-adminオプション 2:
oc get all -n openshift-apiserverこのコマンドをエラーなしで実行できるのは管理ユーザーのみです。