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.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.
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.