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
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_reasonmetric to do this.For the test purpose, I create a deployment with a non-existing image in it to force error to raise:
Then, on my prometheus UI, I launch this query :
during the first minute I have this result :
So,
kube-state-metricreports that my pod is in "ContainerCreating" stateThen, during about 1 minute I have this result :
kube-state-metricreports 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