<p>I have a service that deploys thousands of short lived jobs on Kubernetes each day. I am trying to get Kubernetes to delete these jobs after completion using the functionality described here:</p>

<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#clean-up-finished-jobs-automatically" rel="noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#clean-up-finished-jobs-automatically</a></p>

<p>The job completes, but the Job remains in the cluster after the time limit expressed in <code>ttlSecondsAfterFinished</code>.</p>

<p>I'm testing this on GKE and my master node is running <code>1.12.7-gke.25</code>
I understand this is an alpha feature, but I haven't gotten a single Job to be deleted.</p>

<pre><code>apiVersion: batch/v1 
kind: Job
metadata:
  name: ttl-test
spec:
  ttlSecondsAfterFinished: 100
  template:
    metadata:
      name: ttl-test 
    spec:
      containers:
      - name: test-container
        image: myimage
</code></pre>

<p>In Kubernetes v1.21 the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/" rel="noreferrer">TTL Controller</a> is in beta and enabled by default.</p>
<p>Until Kubernetes v1.20 it was an alpha feature. If you want to use it with a Kubernetes version older than v1.21, make sure alpha features are enabled on your GKE cluster. You can check this on the GCP console UI under Clusters / &lt;your_cluster&gt; / Details / Kubernetes alpha features.</p>
