How to find the cluster-id or name on Openshift cluster?

Solution Verified - Updated

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
  • Red Hat OpenShift Services in AWS (ROSA)
  • Red Hat OpenShift Dedicated (OSD)
  • Red Hat OpenShift in Azure (ARO)

Issue

  • How do you find out what the cluster id/name is on an Openshift cluster?

Resolution

The cluster-id and/or the name with the following commands

RHOCP 3.X

$ oc project openshift-console
$ oc status
  • The cluster-id can be also fetch from the URL https://console.<cluster-id>.openshift.com/.

RHOCP 4.X

$ oc get clusterversion -o jsonpath='{.items[].spec.clusterID}{"\n"}'
  • To find out the name of the cluster:

With the cluster-id access the website This content is not included.Red Hat Hybrid Cloud Console and use the cluster-id previously gotten.


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.