<p>My yaml file</p>

<pre><code>apiVersion: batch/v1
kind: Job
metadata:
  name: auto
  labels:
    app: auto
spec:
  backoffLimit: 5
  activeDeadlineSeconds: 100
  template:
    metadata:
      labels:
        app: auto
    spec:
      containers:
      - name: auto
        image: busybox
        imagePullPolicy: Always
        ports:
        - containerPort: 9080
      imagePullSecrets: 
      - name: imageregistery
      restartPolicy: Never
</code></pre>

<p>The pods are killed appropriately but the job ceases to kill itself post 100 seconds.</p>

<p>Is there anything that we could do to kill the job post the container/pod's functionality is completed.</p>

<pre><code>kubectl version --short

Client Version: v1.6.1
Server Version: v1.13.10+IKS


kubectl get jobs --namespace abc
NAME          DESIRED   SUCCESSFUL   AGE
auto   1         1            26m
</code></pre>

<p>Thank you,</p>

<p>The default way to delete jobs after they are done is to use <code>kubectl delete</code> command.</p>

<p>As mentioned by @Erez:</p>

<blockquote>
  <p>Kubernetes is keeping pods around so you can get the
  logs,configuration etc from it.</p>
</blockquote>

<p>If you don't want to do that manually you could write a script running in your cluster that would check for jobs with completed status and than delete them.</p>

<p>Another way would be to use TTL feature that deletes the jobs automatically after a specified number of seconds. However, <strong>if you set it to zero it will clean them up immediately</strong>. For more details of how to set it up look <a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#job-termination-and-cleanup" rel="nofollow noreferrer">here</a>. </p>

<p>Please let me know if that helped. </p>
