Resource Requests and Limits
Cheat sheet · https://pcornel.dk/topic.php?topic=6153
Answer
Requests reserve CPU and memory for scheduling; limits cap usage. CPU over limit is throttled; memory over limit is OOM-killed. QoS classes (Guaranteed, Burstable, BestEffort) affect eviction.
Remember
Set requests from observed usage (kubectl top, metrics). Memory limits protect nodes; many teams avoid CPU limits to prevent throttling. LimitRanges and ResourceQuotas set namespace defaults/caps.
First checks
kubectl top pod— first check for this topickubectl get pods -o wide— pods, status, node, IPkubectl describe pod <pod>— events and conditionskubectl logs <pod> [-c <c>] [--previous]— container logs (incl. previous crash)kubectl get events --sort-by=.lastTimestamp— recent cluster events
Commands
kubectl top pod
Verify in this order
requests → scheduling; limits → cgroup enforcement → throttle/OOM
Where it usually breaks
Requests set far above usage waste capacity and block scheduling.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6153