<p>I have created a deployment which create a replica-set  and this replica-set create pods. Now I found couple of time the pod is getting deleted (do not know why) and then the replica-set create a new pod.</p>

<p>I am unable to find the details for the previous pod. I need to know why the pod was deleted. Kubernetes server version 1.5.6. I am also not seeing anything in events. Whereas I can see some events in newer version of Kubernetes server.</p>

<p>Please let me know in case of any more information required.</p>

<p>I have given a simple use case here where I created a deployment and then deleted pod inside it:</p>

<pre><code>[kubernate-test]$ kubectl run pod-deleted-reason-why --image=busybox  -- sh -c 'while true; do echo i am running, but not sure can fail any time;sleep 10;done'
deployment "pod-deleted-reason-why" created
[kubernate-test]$ kubectl get deployments |grep reason
pod-deleted-reason-why    1         1         1            1           32s
[kubernate-test]$ kubectl get replicaset |grep reason
pod-deleted-reason-why-59c9df7594    1         1         1         59s
[kubernate-test]$ kubectl get pods |grep reason
pod-deleted-reason-why-59c9df7594-nr8rs    1/1       Running            0          1m
[kubernate-test]$ kubectl delete pod pod-deleted-reason-why-59c9df7594-nr8rs
pod "pod-deleted-reason-why-59c9df7594-nr8rs" deleted
[kubernate-test]$ kubectl get pods |grep reason
pod-deleted-reason-why-59c9df7594-qpq5b    1/1       Running            0          1m
</code></pre>

<p>Here I manually deleted the pod - <code>pod-deleted-reason-why-59c9df7594-nr8rs</code> and replica-set has created a new pod - <code>pod-deleted-reason-why-59c9df7594-qpq5b</code>.</p>

<p>If the the pod was delete for some other reason (say node reboot) how could I know why the pod was deleted?</p>

<p>Describe pod is the way to go. I see this kind of thing everyday. Everytime I launch a new deployment I list the pods with <code>kubectl get pods</code>, then once I see the container creating message for the new pod I want to monitorize, I grab the id and then run <code>kubectl describe pod [ID]</code>. Even if the pod is replaced by a new one you can still see the exit error. You can probably also do <code>kubectl logs [ID]</code> to see more information.</p>
