<p>In order to check status, I started the <code>busybox</code> in kubernetes using interactive shell.</p>

<pre><code>$ kubectl run -i --tty busybox --image=busybox --restart=Never -- sh
/ # exit
$ kubectl run -i --tty busybox --image=busybox --restart=Never -- sh
Error from server (AlreadyExists): pods "busybox" already exists
</code></pre>

<p>When I exit from the shell, I expect the pod will be deleted as well. While it exists there in completed status.</p>

<pre><code>$ kubectl get pods -a
NAME                     READY     STATUS      RESTARTS   AGE
busybox                  0/1       Completed   0          58m
</code></pre>

<p>I have to delete the pod, it is annoying.</p>

<p>DO we have simple parameter I can use to ask k8s to delete the pod for this one task job ?</p>

<p>Just add <code>--rm</code>:</p>

<pre><code>$ kubectl run busybox -i --tty --image=busybox --restart=Never --rm -- sh
If you don't see a command prompt, try pressing enter.
/ # exit
$ kubectl get pod busybox
Error from server (NotFound): pods "busybox" not found
</code></pre>

<blockquote>
  <p><code>--rm=false</code>: If true, delete resources created in this command for attached containers.</p>
</blockquote>
