Skip to content

kube_pod_container_status_waiting_reason strange behaviour #468

Description

@cabrinoob

Hi,
I'am using prometheus to watch the state of running pods on my k8s cluster. I'm using the kube_pod_container_status_waiting_reason metric to do this.

For the test purpose, I create a deployment with a non-existing image in it to force error to raise:

$ kubectl run foo --image foo

Then, on my prometheus UI, I launch this query :

kube_pod_container_status_waiting_reason{reason=~"ContainerCreating|CrashLoopBackOff|ErrImagePull|ImagePullBackOff"} > 0

during the first minute I have this result :

kube_pod_container_status_waiting_reason{app="prometheus",chart="prometheus-6.3.0",component="kube-state-metrics",container="foo",heritage="Tiller",instance="100.97.57.7:8080",job="kubernetes-service-endpoints",kubernetes_name="my-release-prometheus-kube-state-metrics",kubernetes_namespace="prometheus",namespace="jung",pod="foo-6db855bd79-wb2rs",reason="ContainerCreating",release="my-release"}

So, kube-state-metric reports that my pod is in "ContainerCreating" state

Then, during about 1 minute I have this result :

kube_pod_container_status_waiting_reason{app="prometheus",chart="prometheus-6.3.0",component="kube-state-metrics",container="foo",heritage="Tiller",instance="100.97.57.7:8080",job="kubernetes-service-endpoints",kubernetes_name="my-release-prometheus-kube-state-metrics",kubernetes_namespace="prometheus",namespace="jung",pod="foo-6db855bd79-wb2rs",reason="ErrImagePull",release="my-release"}

kube-state-metric reports that my pod is now in "ErrImagePull" state (as expected)

My problem is that this status does not persist more than 1 or 2 minutes, because if I refresh my query, I have a "no data" response while my deployment is still in ImagePullBackOff state.

Is it a normal behaviour?

Thank you for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions