How to get resources consumed by kubernetes job?

1/28/2019

How to get resources (CPU and Memory) consumed by a kubernetes job at the end of job's lifecycle? Is this out of kubernetes job implementation's scope?

Notes:

  • kubectl describe job provides only the limit/request specified.
  • I am aware of external tools to capture the resource consumption. I'm looking for something that could be stored along with job metadata without using any external monitoring tools like prometheus.
-- Jaipradeesh
kubernetes

2 Answers

1/28/2019

we can get resource consumption of pods which are created by job using "kubectl top pod" command but pod must be live at that time.

But Once pods dies we don't have any way to collect resource consumption.

-- Rajesh Deshpande
Source: StackOverflow

1/28/2019

I would not encourage you to only restrict yourself to kubectl top pod. This is only good for quick troubleshoot and sneak peek only.

In production, you must have a more concrete framework for resource usage monitoring and I have found Prometheus very useful. Of course, when you are working on GCP, you may choose native monitoring toolsets also.

-- Raunak Jhawar
Source: StackOverflow