<p>By definition, <code>kube_pod_container_status_waiting_reason</code> is supposed to capture  reasons for a pod in Waiting status.</p>

<p>I have several pods in my kubernetes cluster which are in CrashLoopBackOff but I dont see that reason captured by <code>kube_pod_container_status_waiting_reason</code>.
It only captures two reasons - ErrImagePull and ContainerCreating. </p>

<pre><code>~$ k get pods -o wide --show-all --all-namespaces | grep Crash
cattle-system   cattle-cluster-agent-6f744c67cc-jlkjh       0/1       CrashLoopBackOff   2885       10d       10.233.121.247   k8s-4
cattle-system   cattle-node-agent-6klkh                     0/1       CrashLoopBackOff   2886       171d      10.171.201.127   k8s-2
cattle-system   cattle-node-agent-j6r94                     0/1       CrashLoopBackOff   2887       171d      10.171.201.110   k8s-3
cattle-system   cattle-node-agent-nkfcq                     0/1       CrashLoopBackOff   17775      171d      10.171.201.131   k8s-1
cattle-system   cattle-node-agent-np76b                     0/1       CrashLoopBackOff   2887       171d      10.171.201.89    k8s-4
cattle-system   cattle-node-agent-pwn5v                     0/1       CrashLoopBackOff   2859       171d      10.171.202.72    k8s-5
</code></pre>

<p>Running <code>sum by (reason) (kube_pod_container_status_waiting_reason)</code> in prometheus yields results:</p>

<pre><code>Element                       Value
{reason="ContainerCreating"}    0
{reason="ErrImagePull"}         0
</code></pre>

<p>I am running <code>quay.io/coreos/kube-state-metrics:v1.2.0</code> image of kube-state-metrics.</p>

<p>What am I missing? Why is the CrashLoopBackOff reason not showing up in the query?
I would like to set up an alert which finds pods in the waiting status with the reason. So thinking of merging <code>kube_pod_container_status_waiting</code> to find the pods in the waiting status and <code>kube_pod_container_status_waiting_reason</code> to find the exact reason.</p>

<p>Please assist. Thank you!</p>

Preeti V
<p>You are running into <a href="https://github.com/kubernetes/kube-state-metrics/issues/468" rel="nofollow noreferrer">this</a>. Basically, it looks like you are using <a href="https://github.com/kubernetes/kube-state-metrics" rel="nofollow noreferrer">kube-state-metrics</a> <code>1.2.0</code> or earlier. You see that <code>ImagePullBackOff</code> and <code>CrashLoopBackOff</code> was added in <code>1.3.0</code>.</p>

<p>So update your image to:</p>

<pre><code>k8s.gcr.io/kube-state-metrics:v1.3.0
quay.io/coreos/kube-state-metrics:v1.3.0
</code></pre>

<p>or</p>

<pre><code>k8s.gcr.io/kube-state-metrics:v1.4.0
quay.io/coreos/kube-state-metrics:v1.4.0
</code></pre>
