Finding your way around a cluster
When you first land on an OpenShift cluster — yours or someone else’s — you need four things fast: the console URL, the API endpoint, the admin credentials, and the cluster’s real name. Here’s how to get each without clicking around.
Console and API URLs
Section titled “Console and API URLs”# Web consoleoc whoami --show-console# https://console-openshift-console.apps.my-cluster.example.com
# API serveroc whoami --show-server# https://api.my-cluster.example.com:6443--show-console is the one people forget exists and instead go hunting through
the web UI for. It reads the console route directly.
Who am I, and what can I do?
Section titled “Who am I, and what can I do?”oc whoami # current usernameoc whoami -t # current session tokenoc auth can-i create pods # does my account have a given permission?The cluster’s real name
Section titled “The cluster’s real name”The name you typed at install time isn’t quite the cluster’s canonical identity — OpenShift derives an infrastructure name (with a random suffix) that tags cloud resources and appears in machine names:
oc get infrastructure cluster -o jsonpath='{.status.infrastructureName}'# my-cluster-x7k2pThe admin (kubeadmin) password
Section titled “The admin (kubeadmin) password”Where this lives depends on how the cluster was created:
The installer writes it once to the install directory:
cat <install-dir>/auth/kubeadmin-passwordcrc console --credentialscat ~/.crc/machines/crc/kubeadmin-passwordCluster version and health at a glance
Section titled “Cluster version and health at a glance”oc get clusterversion # version + whether an update is progressingoc get co # cluster operators — all should be Availableoc get nodes # every node should be ReadyIf oc get co shows anything Degraded or Progressing for a long time,
that’s usually where a cluster problem is hiding — start there.