How to find pod termination reason from within pod?

11/9/2019

Here I am using Kubernetes 1.15.3. Is there any way to find termination reason from within pod. while the pod terminates Kubernetes sends the SIGTERM signal to the container's main process when pod's memory exceeds. on pod describe I can see exit status code 137 but is there any way to it from the inside pod.

--
containers
docker
kubernetes

1 Answer

11/9/2019

When you exceed your memory limit, you do not receive and SIGTERM. It’s a SIGKILL and it is not a catchable signal. Your process just ceases to exist.

-- coderanger
Source: StackOverflow