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

Every Pod in a namespace gets `limits.memory: 512Mi` that nobody configured, and big services are OOMKilled.

IntermediateTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → A LimitRange in the namespace injects default limits and defaultRequest into containers that do not set them.

Diagnose →

kubectl get limitrange -n shop -o yaml
kubectl get pod api-x -n shop -o jsonpath='{.metadata.annotations}' | grep -i limitrange

Fix → Set explicit resources on the workload, or adjust the LimitRange defaults to something sensible for that team.

Prevent → Document namespace defaults, and require explicit resources on production Deployments with a policy so defaults are a safety net, not the plan.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination