Skip to main content

OpenShift CLI Cheat Sheet

Once you are logged in as a cluster-admin, you can use the OpenShift CLI (oc) to inspect the different layers of your cluster. OpenShift is organized into Nodes (infrastructure), Cluster Operators (the brains), and Pods/Projects (the workloads).

List OpenShift Nodes

oc get nodes

List Cluster Operators

oc get clusteroperators

List OpenShift Projects

oc projects

Show Logged In User

oc whoami

Miscellaneous

oc adm top nodes	# Shows CPU and Memory usage for each AWS instance.
oc get events -A # Shows a stream of recent system logs/errors across the cluster.
oc get routes -A # Lists all URL endpoints (like the Web Console or your apps).