<p>I have problems to delete automatically the completed jobs which were started by a CronJob.
As I read in this QA <a href="https://stackoverflow.com/a/43116061/5843405">here</a> and <a href="https://stackoverflow.com/questions/36384873/kubernetes-job-cleanup?noredirect=1&amp;lq=1">here</a>, and in the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits" rel="noreferrer">official documentation</a>, this can be done establishing the job history limit
<code>.spec.successfulJobsHistoryLimit</code> and <code>.spec.failedJobsHistoryLimit</code>. I have done it, and it is established to 1 for both cases. But my cluster is saving more than 1 completed job, in fact, it is saving more than the default which is 3 successful jobs and 1 for failed jobs.</p>

<p>My current CronJob configuration is</p>

<pre><code> apiVersion: batch/v1beta1
 kind: CronJob
 metadata:
    name: some-name-cron
 spec:
   schedule: "00 05 1/1 * ?"
   successfulJobsHistoryLimit: 1
   failedJobsHistoryLimit: 1
   jobTemplate:
     spec: ...
</code></pre>

<p>And my versions are:
- Client version: <code>Client Version: version.Info{Major:"1", Minor:"9",</code>
- Server version: <code>Server Version: version.Info{Major:"1", Minor:"8+",</code></p>

<p>So, what I am doing wrong?</p>

<p>I've attached a image with the k8s dashboard.</p>

<p><a href="https://i.stack.imgur.com/WdAcw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WdAcw.png" alt="Dashboard screenshot with the completed Jobs and Pods"></a></p>

<p>You can use jobs history limits <strong>successfulJobsHistoryLimit</strong> and <strong>failedJobsHistoryLimit</strong> to set how many completed and failed jobs should be kept.</p>

<p>You can check for more details on it in the Kubernetes docs here:</p>

<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#jobs-history-limits" rel="noreferrer" title="Kubernetes - Cronjob: Jobs History Limits">Kubernetes - Cronjob: Jobs History Limits</a></p>
