How to measure the time between the creation the job on kubernetes by the user and the time of starting running this job on the node?

10/18/2018

I am running a job with a kubernetes POD and I need to measure the time between the creation the job by the user and the time of starting running this job on the node .

I want to get it through some api.

Does anyone know how can I get it ?

-- Gofrane Haj Ahmed
jobs
kubernetes
pod
time

1 Answer

10/18/2018

Monitoring Kubernetes ( number of pending pods/jobs)

Use the kube-state-metrics package for monitoring and a small Go program called veneur-prometheus to scrape the Prometheus metrics kube-state-metrics emits and publish them as statsd metrics to monitoring system.

For example, here’s a chart of the number of pending pods in the cluster over the last hour. Pending means that they’re waiting to be assigned a worker node to run on. You can see that the number spikes at 11am, because a lot of cron jobs run at the 0th minute of the hour in this case.

Pending pods

An example chart showing pending pods in a cluster over the last hour

-- Ijaz Ahmad Khan
Source: StackOverflow