How to create a cluster-admin user account in ROSA

Solution Verified - Updated -

Environment

  • Red Hat OpenShift Service on AWS (ROSA)
    • 4.x

Issue

  • Is it possible to create a cluster-admin user account directly in a ROSA cluster?

Resolution

Prerequisites:

Please make sure ROSA CLI is already installed on your installation host. If it's not already installed, you can follow the steps from here:

Getting started with the rosa CLI

STEPS

  1. Initiate the following command on your ROSA CLI:
$ rosa create admin --cluster=<your_cluster> --region=<your_region>

(upon executing the above command you will see a similar output as below)

I: Admin account has been added to cluster '<your_cluster>'.
I: Please securely store this generated password. If you lose this password you can delete and recreate the cluster admin user.
I: To login, run the following command:

   oc login https://api.<your_cluster>.x1.openshiftapps.com:6443 --username cluster-admin --password zKGcH-bjSbV-wUTuV-xm9Pz

I: It may take up to a minute for the account to become active.
  1. Use the following 'OC' command to log in to the cluster
$ oc login https://api.<your_cluster>.x1.openshiftapps.com:6443 --username cluster-admin --password zKGcH-bjSbV-wUTuV-xm9Pz
  1. After logging in to the cluster, you can check & verify by following two commands if the created user is cluster-admin or not.
 $ oc whoami
 $ oc describe users/cluster-admin

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments