Last reviewed: November 7, 2026 (Asia/Shanghai); official references checked November 6 UTC.
Direct answer
Review Kubernetes requests and limits by comparing the rendered CPU and memory settings with the namespace’s LimitRange and ResourceQuota, then verify Pod admission, scheduling, and runtime behavior separately. Inventory every container, inspect admission defaults and injected containers, and require evidence from the actual test workload. An accepted Deployment can still fail to create its Pods; an admitted Pod can still fail to schedule.
The Kubernetes resource-management reference explains the central distinction: requests influence scheduling, CPU limits constrain CPU time through throttling, and memory limits can lead to out-of-memory termination. A coding agent that lowers a request or raises a limit has changed a different part of this contract in each case. Review the intended consequence before approving the number.
Who this is for
Use this workflow when a coding agent edits Kubernetes manifests, Helm values, Kustomize overlays, or deployment generators for Linux application Deployments. The examples use container-level CPU and memory fields. Workloads using Pod-level resource budgets or specialized resource accounting need a matching platform review.
Give the agent the approved resource policy, representative workload measurements, and affected environments. Ask for a focused patch and evidence. Use an authorized disposable namespace with representative admission rules for cluster checks.
Key takeaways
- Requests, CPU limits, and memory limits have different consequences.
- Read quantities with their units: CPU
250mand memory256Midescribe different resources. - Review rendered and admitted Pod specifications; defaults can change omitted fields.
- LimitRange constrains individual allocations; ResourceQuota constrains namespace aggregates.
- Separate admission rejection, scheduling failure, throttling, and memory termination in the evidence.
- Keep resource-policy changes visible instead of weakening policy to make the candidate pass.
Sources checked
Four primary Kubernetes references were retrieved successfully on November 6, 2026 UTC:
- Resource Management for Pods and Containers defines requests, limits, resource quantities, scheduling behavior, CPU throttling, memory termination, and troubleshooting observations.
- Limit Ranges explains per-object constraints, default injection, admission failures, and the treatment of existing Pods.
- Resource Quotas explains namespace totals, request and limit quota keys, rejection behavior, and why accepting a Deployment does not guarantee Pod creation.
- kubectl create documents server-side dry run and strict validation.
These maintained technical references support an evergreen review task. Their pages report modifications on July 27, January 4, September 28, and August 26, 2026, respectively. Match the references to the target cluster and client versions. The workflow is a recommendation; this article reports no executed cluster tests or measured deployment outcomes.
Contract details to verify
Read each resource field by its consequence
Record the base revision, candidate revision, renderer and values, cluster version, namespace policy, container names, and expected workload. Then review each changed field:
| Field | Meaning to verify | Evidence needed |
|---|---|---|
| CPU request | Scheduling demand; also influences CPU allocation under contention | Placement requirements and representative CPU demand |
| CPU limit | CPU-time ceiling enforced through throttling | Behavior and latency under the permitted CPU time |
| Memory request | Scheduling demand, rather than a memory-use ceiling | Representative working set and placement requirements |
| Memory limit | Memory boundary with reactive OOM enforcement | Peak working set, termination records, and recovery behavior |
The resource-management reference defines 100m CPU as 0.1 CPU. For memory, M means decimal megabytes and Mi means mebibytes. Lowercase m means millibytes: 400m memory expresses 0.4 bytes. A syntactically accepted quantity can therefore be a serious sizing error. Have the agent explain the interpreted value as well as copying the YAML.
Also inspect missing fields. If a resource has a limit, no request, and no admission-time request default, Kubernetes copies that limit into the request. A patch that adds only a limit can consequently change scheduling demand too.
This fragment belongs inside a container list in a complete workload:
- name: api
resources:
requests:
cpu: "250m"
memory: "256Mi"
limits:
cpu: "1"
memory: "512Mi"
These are illustrative values. Derive deployment values from representative workloads and repository policy. Verify request-versus-limit consistency for both resources and preserve the policy’s explicit decision about CPU limits.
Compare the rendered workload with namespace policy
Render every affected environment with its actual values or overlay. Inventory application containers and init containers, then inspect the admitted Pod for injected containers. Use the target platform’s effective Pod accounting when calculating scheduling and quota demand; a total that includes only the main application can omit other resource consumers.
Read the namespace rules before interpreting admission results. The following command is read-only; replace the example context and namespace explicitly:
kubectl --context review-cluster --namespace agent-review \
get limitrange,resourcequota -o yaml
The LimitRange reference describes minimums, maximums, limit-to-request ratios, and defaults. Review the final request and limit together after defaulting. If several LimitRanges define defaults, Kubernetes says the selected default is nondeterministic. Resolve that policy ambiguity with the platform owner.
The ResourceQuota reference
distinguishes requests.cpu, requests.memory, limits.cpu, and limits.memory. Compare the matching quantity with current usage and the hard limit. A namespace can have room for the new requests while lacking room for the new limits.
Include the highest simultaneous replica count permitted by the rollout plan. For five concurrent copies of the single-container example, requests alone total 1250m CPU and 1280Mi memory. Add other containers and namespace workloads using the applicable accounting rules. Quota headroom also does not guarantee node capacity: admission and scheduling answer separate questions.
Test Pod admission and inspect the resulting settings
Have the repository’s rendering workflow produce a complete Pod fixture as review-pod.json from the candidate’s Pod template. Preserve relevant labels, annotations, and all container entries. Choose a fixture name absent from the disposable namespace and ensure its namespace matches the command. Account for admission behavior that depends on controller ownership by also exercising the real Deployment path when relevant.
With kubectl and jq installed, submit the Pod without persisting it:
kubectl --context review-cluster --namespace agent-review \
create --dry-run=server --validate=strict -f review-pod.json \
-o json > admitted-review-pod.json
Check the command’s exit status before reading its output. The kubectl reference says server dry run submits a server-side request without persisting the resource. It does not start containers or reserve future quota headroom.
Inspect the effective resource blocks:
jq '{
containers: [.spec.containers[] | {name, resources}],
initContainers: [.spec.initContainers[]? | {name, resources}]
}' admitted-review-pod.json
Keep the full admitted object under the repository’s normal access controls; attach a sanitized resource summary to review. Compare every defaulted or injected allocation with the intended contract.
Next, make one intentional violation in a copy of the fixture. If the test namespace has a Container LimitRange maximum CPU of 2, sufficient quota headroom, and no earlier conflicting constraint, changing the example’s CPU limit from 1 to 3 should produce a maximum-limit rejection. Retain the diagnostic identifying that rule. A generic 403 can also come from authorization or another policy.
Test quota separately with a fixture that satisfies the per-container rules but exceeds the relevant remaining namespace quota. Require the quota-specific diagnostic. Removing a request is an unreliable negative test because defaults may restore it. Restore the valid fixture between cases, and keep namespace policy changes outside the agent’s attempted repair.
Distinguish admission, scheduling, and runtime failures
Use the approved test deployment workflow to run the candidate with synthetic traffic. Keep the image, workload mix, replica count, observation duration, and testbed comparable with the baseline. Exercise startup and a bounded representative burst, then retain both performance and container-status evidence.
| Observation | Interpretation to investigate | Evidence to retain |
|---|---|---|
| Pod creation is rejected | Allocation violates an admission rule or quota | Exact rejection and matching namespace rule |
| Deployment exists but expected Pods do not | Controller may be unable to create them | Deployment/controller diagnostics and creation failures |
Pod is unscheduled with FailedScheduling | Requests may not fit eligible nodes | Scheduling message, effective requests, and node allocatable resources |
| Container remains running but becomes slow under CPU demand | CPU throttling may constrain progress | CPU throttling observations, request latency, and workload conditions |
Container reports OOMKilled | Memory termination needs diagnosis | Pod UID, container, termination record, restart change, and memory observations |
Treat these as diagnostic paths. Pending alone does not identify a CPU shortage, and a restart alone does not prove a memory-limit failure. Correlate the specific reason with resource settings and observations. A single low usage snapshot cannot establish safe peak requirements.
After a candidate passes admission, verify that the actual Pods appear, schedule, become ready, and serve the synthetic workload within the agreed behavior limits. Use the health-probe review workflow to check readiness and restart behavior when those settings also change.
If memory grows unexpectedly across repeated operations, use the resource-leak testing guide to investigate application lifecycle behavior before accepting a larger memory budget.
Failure modes
The agent lowers requests to clear a scheduling error. The new Pod may fit while understating its representative demand. Require workload measurements and an explicit capacity decision.
A memory-unit typo survives schema validation. Inspect interpreted quantities, especially lowercase m, and add a repository policy check for implausible values.
A limit-only change silently increases the request. Inspect admission defaults and the final Pod specification before computing placement or quota impact.
Deployment acceptance is reported as success. Require Pod creation and scheduling evidence; quota can block the resulting Pods.
A policy edit is expected to repair existing Pods. The LimitRange reference says existing Pods remain unchanged when that policy changes. Verify newly created Pods through the intended rollout.
The fix removes a limit or increases quota without review. Diagnose the failing boundary and route any resource-policy change to its owner with the additional demand stated explicitly.
FAQ
Must CPU requests equal CPU limits?
There is no universal requirement that they match. Requests and limits serve different purposes. Choose their relationship from workload needs and namespace policy, including any enforced ratio. Preserve a deliberate policy choice when reviewing the patch.
Does raising the memory limit fix an OOM failure?
It can accommodate a legitimate larger working set, provided capacity and policy permit it. First reproduce the failure and investigate memory growth. A larger allowance can postpone the same failure when the application retains memory unintentionally.
Are LimitRange and ResourceQuota interchangeable?
No. LimitRange governs individual allocations and can inject defaults. ResourceQuota constrains aggregate namespace consumption. A candidate must satisfy both applicable policies and still fit eligible nodes.
Reader next step
Choose one agent-written resource change. Render its effective Pod template, record namespace defaults and quota, and explain each changed quantity. Run the valid Pod admission check and one targeted policy violation, then exercise the approved test Deployment. Attach the admitted resource summary, admission diagnostics, scheduling observations, and runtime results to the pull request before approval.