Production notebook
Kubernetes in production: resource limits that actually prevent outages
How to tune requests and limits without starving the pods
Resource limits in Kubernetes seem simple until a pod starts restarting for no apparent reason. This review compares poorly calibrated requests and limits with configurations that sustain variable workloads, shows manifest snippets, and explains how to read scheduler and kubelet events to distinguish memory shortage from CPU throttling.
It also discusses the most common mistakes when copying values from a test environment to production and which metrics should be monitored before touching the numbers. The starting point is usually the same: a node that begins to show high latency, pods restarting in a chain, and an observability dashboard where the spike appears right when no one was deploying.
Before intervening, it is worth checking the state of the nodes, the scheduler events, and the resource pressure reported by the kubelet. Distinguishing an OOMKill from CPU throttling completely changes the decision: in one case the memory limit is below what the process actually needs, while in the other the container is receiving fewer cycles than it believes it has.
A manifest with reasonable requests and limits should not be copied from one environment to another without review. Production workloads have bursts that tests do not reproduce, and values that worked in a small cluster stop being useful when traffic is distributed differently. The practical recommendation is to adjust one resource at a time, let the real workload run, and read the metrics again before the next change.