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

A JVM app is killed during startup with `Liveness probe failed` before it ever becomes ready; startup takes about 90 seconds.

IntermediateTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → Liveness starts checking after initialDelaySeconds and kills the container before the app finishes booting. The container restarts and boots again forever.

Diagnose →

kubectl describe pod api-x | grep -E 'Liveness|Started|Killing'
kubectl logs api-x --previous | grep -i 'started in'

Fix → Use a startup probe. Liveness and readiness are disabled until it succeeds:

startupProbe:
  httpGet: {path: /livez, port: http}
  periodSeconds: 5
  failureThreshold: 36      # up to 180s to start

Prevent → Every slow-starting service gets a startup probe sized to its worst-case boot time, not a large initialDelaySeconds.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination