Interview Prep/Real-World Interview/Deployments and releases

Kubernetes pods restart every few hours after a new release, with exit code 137. What's going on?

BeginnerScenarioDeployments and releases
Answer

Situation read → Exit 137 is SIGKILL, almost always OOMKilled. Restarts every few hours point to a memory leak or a too-low limit after the release.

What I'd do →

  1. Confirm:
kubectl describe pod api-xyz -n prod | grep -A3 "Last State"
# Reason: OOMKilled
  1. Plot container_memory_working_set_bytes for the pod: a steady climb is a leak; a sudden spike is a big request or batch.
  2. Compare with the previous release; if the memory profile changed, it's a regression.
  3. Short term: raise the limit or roll back. For JVMs check -XX:MaxRAMPercentage, since the heap may not respect container limits as configured.
  4. Long term: heap profiles, then fix the leak.

Why → Raising the limit only buys time on a leak; it will still OOM, just later.

Interview tip → Distinguish container OOMKill (limit hit) from node-pressure eviction (status Evicted).

All Real-World Interview questions Roadmap: Interview readiness

More on Deployments and releases