<p>In my case I have not added any parameter for backofflimit in kind:job
so job will retry for 6 times and if it is completed it will remove all pods Error and Completed as used hook delete policy.</p>
<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: create-job
  annotations:
    &quot;helm.sh/hook&quot;: &quot;post-install&quot;
    &quot;helm.sh/hook-delete-policy&quot;: &quot;hook-succeeded,before-hook-creation&quot;
    &quot;helm.sh/hook-weight&quot;: &quot;1&quot;
spec:
  template:
    spec:
      restartPolicy: Never
      containers:
      - name: create-job
</code></pre>
<p>Problem Statement: This job is dependent on another Pod, So now that pod is taking time to come in running state.
So job runs for 6 times and not able to succeed, I have added backofflimit: 10, now the job reties 10 times and if it success in between then does not removed Error and Completed pods by default.</p>
<p>Thanks</p>

<p>Your failed pod should be automatically deleted once hitting backofflimit (default to 6) if your restartPolicy is defined as onFailure.</p>
<p>In my case - cronjob defined and should run every 15mins:
<a href="https://i.stack.imgur.com/h0aj7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h0aj7.png" alt="enter image description here" /></a></p>
<p>All my job histories kept:
<a href="https://i.stack.imgur.com/2g6h5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2g6h5.png" alt="enter image description here" /></a></p>
<p>Describe the job - which tells it hit backoffLimit
<a href="https://i.stack.imgur.com/mAKbr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mAKbr.png" alt="enter image description here" /></a></p>
<p>The failed pod got deleted.
<a href="https://i.stack.imgur.com/aogVG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aogVG.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/M4wsk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M4wsk.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/4twxD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4twxD.png" alt="enter image description here" /></a></p>
<p>Check it out <a href="https://github.com/kubernetes/kubernetes/issues/74848" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/74848</a></p>
