Interview Prep/Kubernetes/Resources, OOM, probes and termination

A container restarts with `Reason: Error, Exit Code: 137` but not `OOMKilled`.

AdvancedTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → 137 is SIGKILL from something other than the cgroup OOM killer: the kubelet killing after the grace period expired (liveness failure or deletion with a hung shutdown), a node-level OOM that killed a child process, or an external kill -9.

Diagnose →

kubectl get events --field-selector involvedObject.name=api-x --sort-by=.lastTimestamp
kubectl debug node/<node> -it --image=ubuntu:24.04 -- chroot /host journalctl -u kubelet --since "30 min ago" | grep api-x

Fix → If preceded by Killing ... failed liveness probe, fix the probe and shutdown handling. If node dmesg shows OOM for a child process (worker processes under a supervisor), raise the limit or reduce workers.

Prevent → Do not assume 137 means memory; read events and kubelet logs together.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination