<p>I have batch jobs that I want to run on Kubernetes. The way I understand Jobs:</p>

<p>If I choose <code>restartPolicy: Never</code> it means that if the Job fails, it will destroy the Pod and reschedule onto (potentially) another node. If <code>restartPolicy: OnFailure</code>, it will restart the container in the existing Pod. I'd consider a certain number of failures unrecoverable. Is there a way I can prevent it from rescheduling or restarting after a certain period of time and cleanup the unrecoverable Jobs?</p>

<p>My current thought for a workaround to this is to have some watchdog process that looks at retryTimes and cleans up Jobs after a specified number of retries.</p>

<p>Summary of slack discussion:</p>

<p>No, there is no retry limit. However, you can set a deadline on the job as of v1.2 with <code>activeDeadlineSeconds</code>. The system should back off restarts and then terminate the job when it hits the deadline.</p>
