I have a question regarding the
CronJob resource. In the spec I have set both
failedJobsHistoryLimit to 3 and
backoffLimit=0 to basically always keep history of minimum last 3 jobs and not retry a job if it fails for any reason (e.g. OOM). This works, but what I am seeing is that the PODs are terminated (deleted) immediately as they fail even though the jobs are kept according to the history limits.
According to the Job docs:
“When a Job completes, no more Pods are created, but the Pods are not deleted either. Keeping them around allows you to still view the logs of completed pods to check for errors, warnings, or other diagnostic output. The job object also remains after it is completed so that you can view its status.”
This seems to contradict the behavior I am seeing (pods are deleted). Is this by any chance different for CronJobs or is there a bug?
I am running GKE 1.11.7-gke.4
I want to be able to find out why a previous job has failed but this is not possible if the pod is deleted immediately.