What this thread does
Do first: run kubectl describe pod POD and compare container termination reasons with Pod events before changing resource limits.
Short answer
As of November 2026, use Kubernetes current docs, November 2026. Requests influence scheduling; CPU limits throttle and memory limits can lead to OOM kills (resource reference, modified October 21, 2026). Select values from sustained demand, bursts and node capacity; a single snapshot cannot establish them. bobrik’s August 20, 2018 report documents unnecessary quota throttling as a historical failure mode, not a claim about every current kernel.
Choose / don't choose
- Explicit CPU cap: choose for workload isolation or quota requirements; avoid a cap near average usage when legitimate bursts need more CPU. Compare latency with throttled periods under the intended load.
- Memory limit: choose a measured peak plus margin that fits node capacity; increasing it cannot repair an unbounded leak.
- Graceful deletion: choose when accepted work must drain; do not use force deletion as a drain check.
Not for: generated-manifest review; see agent-written-kubernetes-manifests-probes-limits-kubeconform.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
resources.requests.cpu | Reserve measured sustained CPU; docs example 250m, not a workload recommendation | Container resources; current docs | resources |
resources.limits.cpu | Cover legitimate bursts or omit if policy permits; docs example 500m; cap enforces throttling | Container resources; current docs | resources |
resources.requests.memory | Reserve representative working-set demand; docs example 64Mi | Container resources; current docs | resources |
resources.limits.memory | Cover observed peak including startup/bursts plus measured margin; docs example 128Mi | Container resources; current docs | resources |
terminationGracePeriodSeconds | Default 30; choose more than hook time + worst acceptable drain + cleanup margin | Pod spec; current docs | lifecycle |
PreStop hook | Run before TERM; consumes the same grace budget, not an extra allowance | Container lifecycle; current docs | lifecycle |
Order of operations
1. Collect per-container CPU, throttled periods, request latency, memory working set and peak usage across startup, peak traffic and a full job cycle. Record node allocatable resources and placement headroom. Compare any admission-policy defaults with the manifest (resources). 2. Choose requests from that series and limits from allowed bursts. Re-run representative traffic while observing throttling and OOM events. These are sizing decisions, not universal ratios. 3. On ordinary deletion the grace timer includes preStop, then the runtime signals process 1; at expiry remaining processes receive SIGKILL. Terminating endpoints stop advertising readiness in parallel. Handle TERM in the application and retain dependencies until accepted work drains (termination flow). 4. Derive the grace value from hook duration + maximum permitted in-flight duration + cleanup and routing margin. In a disposable replica delete during a long request; require completion or an explicit timeout outcome and exit before the configured deadline. The small emergency hook extension is not routine budget.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
OOMKilled | The container tried to use more memory than its limit | Inspect last container state, limits, memory peak and node OOM evidence; repair leak/burst or adjust capacity | resource behavior, OOM example |
Evicted | Kubelet reclaims resources under node pressure; this is a Pod-level failure | Inspect Pod reason/events and node MemoryPressure; address node headroom, requests and competing usage rather than only raising this container limit | eviction |
CFS quotas can lead to unnecessary throttling | CFS quotas can lead to unnecessary throttling | Compare throttle counters, CPU cap and kernel behavior before attributing all latency to code | bobrik report |
Missing
- The linked source does not confirm: Container termination can indicate a cgroup or node OOM; exit status alone is insufficient.
- No workload measurements are available, so concrete CPU/memory quantities and a final grace number cannot be selected. The example quantities are documentation examples only. Hard node-pressure eviction may bypass ordinary graceful-deletion expectations.
Checked
2026-11-12; Kubernetes current docs, November 2026; resource, lifecycle, eviction references and bobrik report read. No application commands were executed.
Started from a post by @Kubernetes current docs, November 2026, packaged by the editor. Original post