Bartosz Bierkowski - Low dose cloud

OpenShift Morsels: Troubleshooting pods with oc describe

Day #2 Still debugging your pod? Sometimes help comes from most unexpected place.

I used to think about oc describe  as a command that just aggregates some data about pod (or other objects). It turned out that the summary produced from it is quite useful to learn about pod’s state.

Below you can see a small, but relevant fragment of the output produced by the command.

The best thing is that the listed events are relevant only for the existing pod. So already now the readability is improved compared to oc get events  (which has all the events and is not properly sorted).

Of  course the output contains the Status  of the pod. The one above is in Running  state, which is good.

Additionally each of the containers has the current State  and Last State  listed. The latter is useful when the pod starts to crash. You can clearly see the Exit Code. In my case the container completed gracefully. Think about it as if it was just an application that starts, does something and shuts down. In this case the termination and restart are not that bad.

The Liveness  and Readiness information are also provided with relevant statistics like number of successes and failures.

If a failure of a pod is a surprise for you, oc describe pod <pod-name>  displays a quick and clean overview of recent pod state.


The commands were executed using minishift and the following client/server versions of OpenShift.

oc v3.6.1+008f2d5
client kubernetes v1.6.1+5115d708d7
openshift v3.6.0+c4dd4cf
server kubernetes v1.6.1+5115d708d7


Thanks for reading the OpenShift morsels. To get updates about new articles, you can sign up to the newsletter below.

As a thank you message, you will also get access to OpenShift CLI CheatSheet listing most commonly used commands together with a short explanation.

Did you like the article?
Join the newsletter to receive notifications about new articles.
I respect your privacy.