<p>I know I can view logs of a crash pod by using
kubectl logs  --previous</p>

<p>But if a pod belongs to a deployment, when it crashes, a new pod with a different name is going to be created.</p>

<p>I can no longer know the crashed pod name.</p>

<p>Where can I find the log of the crashed pod?</p>

<p>And how can I  know if/when/why the pod crashed?</p>

newme
<p>If a Deployment-managed Pod crashes, the same Pod will restart, and you can look at its logs using <code>kubectl logs --previous</code> the same as before.</p>

<p>If you manually <code>kubectl delete pod</code> something a Deployment manages, you'll lose its logs and the Deployment will create a new one; but you have to explicitly do that, if a pod fails it will be the same pod restarting (or in <code>CrashLoopBackOff</code> state).</p>
