<p>I have to process tasks stored in a work queue and I am launching this kind of Job to do it:</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: pi
spec:
  template:
    spec:
      parallelism: 10
      containers:
      - name: pi
        image: perl
        command: [&quot;some&quot;,  &quot;long&quot;, &quot;command&quot;]
      restartPolicy: Never
  backoffLimit: 0
</code></pre>
<p>The problem is that if one of the Pod managed by the Job fails, the Job will terminate all the other Pods before they can complete. On my side, I would like the Job to be marked as failed but I do not want its Pods to be terminated. I would like them to continue running and finish processing the items they have picked in the queue.</p>
<p>Is there a way to do that please?</p>

<p>As it already mentioned in the comments, you can set <code>restartPolicy: OnFailure</code>, that means kubelet will perform restarts until the Job succeeds. However every retry <a href="https://docs.openshift.com/container-platform/4.1/nodes/jobs/nodes-nodes-jobs.html" rel="nofollow noreferrer">doesn't increment the number of failures</a>. However, you can set <code>activeDeadlineSeconds</code> to some value in order to avoid a loop of failing.</p>
