How do I check if a Kubernetes pod was killed for OOM or DEADLINE EXCEEDED?

Viewed 22926

I have some previously run pods that I think were killed by Kubernetes for OOM or DEADLINE EXCEEDED, what's the most reliable way to confirm that? Especially if the pods weren't recent.

2 Answers

If the pod has already been deleted, you can also check kubernetes events and see what's going on:

$ kubectl get events

LAST SEEN   FIRST SEEN   COUNT    NAME                                               KIND                      SUBOBJECT                                     TYPE      REASON                SOURCE    MESSAGE
59m         59m          1        my-pod-7477dc76c5-p49k4                            Pod                       spec.containers{my-service}                   Normal    Killing               kubelet   Killing container with id docker://my-service:Need to kill Pod
Related