<p>My k8s pod gets terminated/crashed sometimes and restarts automatically. When I try to see the old log to debug for the crash, I get the below error. If terminated container not found, then how can I get the log and debug the crash in this case?</p>
<p>My pod has only one container inside it.</p>
<pre><code>/home/ravi&gt; sudo kubectl logs -p mypod-766c995f8b-zshgc -n ricplt 
Error from server (BadRequest): previous terminated container &quot;container-ricplt-e2term&quot; in pod &quot;mypod-766c995f8b-zshgc&quot; not found
</code></pre>

myquest9 sh
<p>I recommend you to use tool like LENS to have a GUI to have a clarity on what is going on in K8S cluster.Also you can use kubectl get events to know the history of events happened along with age of event,pod info , etc. It can help you to know for what reason the old container has been terminated.</p>
