<p>How can I clean up the failed and completed pods created by kubernetes job automatically without using cronjob. I want to keep only the last pod created by job.</p>
<p>How can we accomplish that?</p>

cloudbud
<p><code>...clean up the failed and completed pods created by kubernetes job automatically without using cronjob</code></p>
<p>If you specify <a href="https://kubernetes.io/docs/concepts/workloads/controllers/job/#ttl-mechanism-for-finished-jobs" rel="nofollow noreferrer">ttlSecondsAfterFinished</a> to the same period as the Job schedule, you should see only the last pod until the next Job starts. You can prolong the duration to keep more pods in the system this way and not wait until they are explicitly delete.</p>
