<p>The <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/%22Kubernetes%20Docs%22" rel="nofollow noreferrer">Kubernetes Docs</a> say the following:</p>

<blockquote>
  <p>In general, Pods do not disappear until someone destroys them. This
  might be a human or a controller. The only exception to this rule is
  that Pods with a phase of Succeeded or Failed for more than some
  duration (determined by the master) will expire and be automatically
  destroyed.</p>
</blockquote>

<p>What is the default value for this duration and how do I set it? My pods also never enter the Succeeded or Failed phase, rather they enter Completed or Error phase respectively. Is this to be expected; are the docs out of date?</p>

<p>I check the pod phases using <code>kubectl get pods --show-all</code>, where information about them seems to persist. Is there any additional cleanup necessary? Running <code>kubectl get pods</code> without <code>--show-all</code> does not show any pods after they destroyed.</p>

<p>I am creating pods with <code>kubectl apply -f k8/dummy-pod.yaml</code> and the following yaml file:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: dummy.3
  labels:
    vara: a
    role: idk
spec:
  hostNetwork: true
  restartPolicy: Never
  containers:
  - image: gcr.io/gv-test-196801/dummy:v2
    name: dummy-1
</code></pre>

<p>I believe this documentation is out of date.<br>
Pod garbage collection using TTL <a href="https://github.com/kubernetes/kubernetes/pull/12055" rel="nofollow noreferrer">was abandoned</a> in favor of a threshold number of terminated pods. <code>--terminated-pod-gc-threshold</code> on the kube controller manager (<a href="https://kubernetes.io/docs/reference/generated/kube-controller-manager/" rel="nofollow noreferrer">docs here</a>).   </p>

<p>Currently deleting a <code>DaemonSet, Deployment, ReplicaSet or StatefulSet</code> will orphan its pods by default.<br>
You can work around this by <a href="https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#foreground-cascading-deletion" rel="nofollow noreferrer">enabling cascading deletes</a>
<br>
This behavior will change in 1.10</p>

<blockquote>
  <p>Prior to apps/v1 the default garbage collection policy for Pods in a
  DaemonSet, Deployment, ReplicaSet, or StatefulSet, was to orphan the
  Pods. That is, if you deleted one of these kinds, the Pods that they
  owned would not be deleted automatically unless cascading deletion was
  explicitly specified</p>
</blockquote>

<p>see <a href="http://blog.kubernetes.io/" rel="nofollow noreferrer">kubernetes blog</a></p>
