<p>Is there a way to get some details about Kubernetes pod that was deleted (stopped, replaced by new version).</p>

<p>I am investigating bug. I have logs with my pod name. That pod does not exist anymore, it was replaced by another one (with different configuration). New pod resides in same namespace, replication controller and service as old one.</p>

<p>Commands like</p>

<pre><code>kubectl  get pods
kubectl  get pod &lt;pod-name&gt; 
</code></pre>

<p>work only with current pods (live or stopped). </p>

<p>How I could get more details about old pods? I would like to see</p>

<ol>
<li>when they were created </li>
<li>which environment variables they had when created    </li>
<li>why and when they were stopped</li>
</ol>

<p>As of today, <code>kubectl get pods -a</code> is deprecated, and as a result you cannot get deleted pods.</p>

<p>What you can do though, is to get a list of recently deleted pod names - up to 1 hour in the past unless you changed the <code>ttl</code> for kubernetes events - by running:</p>

<p><code>kubectl get event -o custom-columns=NAME:.metadata.name | cut -d "." -f1</code></p>

<p>You can then investigate further issues within your logging pipeline if you have one in place.</p>
