I've been running openshift (okd) in my homelab for about a month now for all my container needs and so far, I really like what I see. Along the way, I had to debug some issues so here are a few commands that should help you getting started in finding the root cause of a problem.
Gathering information:
$ oc get nodes -o wide
$ oc get pods -A -o wide
$ oc adm top node
$ oc -n ${namespace} get events [-o wide]
$ oc -n ${namespace} describe ${resourceype}/${resourcename}
Check why pods are failing:
$ oc -n ${namespace} logs [-f | --tail=${linecount}) deployments/${deployment}
$ oc -n ${namespace} logs [-f | --tail=${linecount}] pods/${pod}
$ oc -n ${namespace} get pods/${podname} -o jsonpath='{.status.containerStatuses}' | jq
$ oc -n ${namespace} get pods/${podname} -o yaml | oc adm policy scc-subject-review -f -
Checking what pods are behind a given service:
$ oc -n ${namespace} get endpoints ${service}
Some useful commands for debugging pods / nodes:
$ oc -n ${namespace} debug pods/${pod}
$ oc -n ${namespace} debug node/${nodename}
Getting info about a certain container image using skopeo (+example):
$ skopeo inspect --config docker://${registry}/${repository}:${tag} | jq | less
$ skopeo inspect --config docker://docker.io/library/debian:11 | jq -r .config.Env
I will probalby add more commands over time
Feel free to comment and / or suggest a topic.
Comments
Post a Comment