Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monitoring a kubernetes job

I have kubernetes jobs that takes variable amount of time to complete. Between 4 to 8 minutes. Is there any way i can know when a job have completed, rather than waiting for 8 minutes assuming worst case. I have a test case that does the following:

1) Submits the kubernetes job.
2) Waits for its completion.
3) Checks whether the job has had the expected affect.

Problem is that in my java test that submits the deployment job in the kubernetes, I am waiting for 8 minutes even if the job has taken less than that to complete, as i dont have a way to monitor the status of the job from the java test.

like image 696
trial999 Avatar asked Aug 25 '16 13:08

trial999


People also ask

How do you monitor Kubernetes?

The most straightforward solution to monitor your Kubernetes cluster is by using a combination of Heapster to collect metrics, InfluxDB to store it in a time series database, and Grafana to present and aggregate the collected information. The Heapster GIT project has the files needed to deploy this design.

How can I check my job status in Kubernetes?

Running an example Job It takes around 10s to complete. Check on the status of the Job with kubectl : kubectl describe job pi. kubectl get job pi -o yaml.


1 Answers

$ kubectl wait --for=condition=complete --timeout=600s job/myjob
like image 85
Vojtech Vitek Avatar answered Oct 26 '22 01:10

Vojtech Vitek