Skip to content

Openshift - Troubleshooting: Basics

Commands

Get Cluster version:

oc get clusterversion

Get Cluster ID:

oc get clusterversion -o jsonpath='{.items[].spec.clusterID}{"\n"}'

Create dump file for RH Support:

oc adm must-gather

Start debug session on a node:

oc debug no/{node}

Display requests counts by API:

oc get apirequestcounts

# Only deprecated
oc get apirequestcounts -o jsonpath='{range .items[?(@.status.removedInRelease!="")]}{.status.requestCount}{"\t"}{.status.removedInRelease}{"\t"}{.metadata.name}{"\n"}{end}'

Tips

Get pod count by node:

oc get pod -A -o wide | awk '!/^NAMESPACE/ && $8 != "<none>" {print $8}' | sort | uniq -c

Get all nodes performances (CPU/RAM):

for n in $(oc get node -o name | sed 's%node/%%g'); do oc adm top node $n; done

Problems

Back to top