---
source: https://iinventedlight.com/library/notes/kubernetes-limit-ranges.md
title: "Kubernetes LimitRange sets default and min/max CPU and memory per container in a namespace"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Kubernetes docs); CC-BY-4.0 (kubernetes/website (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Limit Ranges; kubernetes/website (GitHub), limit-range.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: kubernetes limit ranges"
tags: [kubernetes, limitrange, resources, namespaces, defaults]
client: Librarian
sources:
  - id: S1
    title: "Limit Ranges"
    publisher: Kubernetes docs
    url: https://kubernetes.io/docs/concepts/policy/limit-range/
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "limit-range.md (source page)"
    publisher: kubernetes/website (GitHub)
    url: https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/policy/limit-range.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# Kubernetes LimitRange sets default and min/max CPU and memory per container in a namespace
**Answer:** Create a LimitRange in the namespace with `default`, `defaultRequest`, `min` and `max` for `type: Container`. A LimitRange is a policy that constrains the limits and requests you can specify for each object kind, such as Pod or PersistentVolumeClaim, in a namespace.

## Example

```yaml
apiVersion: v1
kind: LimitRange
metadata:
  name: cpu-resource-constraint
spec:
  limits:
  - type: Container
    default:
      cpu: 500m
    defaultRequest:
      cpu: 500m
    max:
      cpu: "1"
    min:
      cpu: 100m
```

## What it can enforce

- Minimum and maximum compute resource usage per Pod or Container.
- Minimum and maximum storage request per PersistentVolumeClaim.
- A ratio between request and limit for a resource.
- Default requests and limits, injected automatically into containers that set none.

## Admission rules

- First the LimitRange admission controller applies defaults to Pods without compute resource requirements; then it checks minimum, maximum and ratio.
- A Pod or PersistentVolumeClaim that violates a constraint fails with HTTP status code `403 Forbidden`.
- Validation happens only at Pod admission. If you add or modify a LimitRange, the Pods that already exist continue unchanged.
- With two or more LimitRange objects in a namespace, it is not deterministic which default value will be applied.
- A LimitRange does not check that its defaults are consistent. A default limit below a container's request, such as a 500m limit with a 700m request, makes the Pod not schedulable.

## Why use it

By default, containers run with unbounded compute resources. A ResourceQuota caps the namespace total, while a LimitRange makes sure a single object cannot monopolize all available resources within the namespace and fills in defaults that quotas require.

## See also

- [kubernetes-resource-quotas](https://iinventedlight.com/library/notes/kubernetes-resource-quotas/)
- [kubernetes-resource-requests-limits](https://iinventedlight.com/library/notes/kubernetes-resource-requests-limits/)
- [kubernetes-namespaces](https://iinventedlight.com/library/notes/kubernetes-namespaces/)

## Claims

- id: C1
  claim: Containers run with unbounded compute resources by default.
  source: S1
  evidence: "By default, containers run with unbounded"

- id: C2
  claim: LimitRange validation occurs only at Pod admission.
  source: S2
  evidence: "LimitRange validations occur only at Pod admission stage, not on running Pods."

- id: C3
  claim: Multiple LimitRanges make the applied default nondeterministic.
  source: S2
  evidence: "it is not deterministic which default value will be applied"

## Sources

- [S1] Limit Ranges. Kubernetes docs. https://kubernetes.io/docs/concepts/policy/limit-range/ . License: CC-BY-4.0. Accessed 2026-11-18.

- [S2] limit-range.md (source page). kubernetes/website (GitHub). https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/policy/limit-range.md . License: CC-BY-4.0. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Limit Ranges; kubernetes/website (GitHub), limit-range.md (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
