Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,26 @@ a Pod.
For a particular resource, a *Pod resource request/limit* is the sum of the
resource requests/limits of that type for each container in the Pod.

## Pod-level resource specification

{{< feature-state feature_gate_name="PodLevelResources" >}}

Starting in Kubernetes 1.32, you can also specify resource requests and limits at
the Pod level. the Pod level. At Pod level, Kubernetes {{< skew currentVersion >}}
only supports resource requests or limits for specific resource types: `cpu` and /
or `memory`. This feature is currently in alpha and with the feature enabled,
Kubernetes allows you to declare an overall resource budget for the Pod, which is
especially helpful when dealing with a large number of containers where it can be
difficult to accurately gauge individual resource needs. Additionally, it enables
containers within a Pod to share idle resources with each other, improving resource
utilization.

For a Pod, you can specify resource limits and requests for CPU and memory by including the following:
* `spec.resources.limits.cpu`
* `spec.resources.limits.memory`
* `spec.resources.requests.cpu`
* `spec.resources.requests.memory`

## Resource units in Kubernetes

### CPU resource units {#meaning-of-cpu}
Expand Down Expand Up @@ -177,6 +197,19 @@ spec:
cpu: "500m"
```

## Pod resources example {#example-2}

{{< feature-state feature_gate_name="PodLevelResources" >}}

The following Pod has an explicit request of 1 CPU and 100 MiB of memory, and an
explicit limit of 1 CPU and 200 MiB of memory. The `pod-resources-demo-ctr-1`
container has explicit requests and limits set. However, the
`pod-resources-demo-ctr-2` container will simply share the resources available
within the Pod resource boundaries, as it does not have explicit requests and limits
set.

{{% code_sample file="pods/resource/pod-level-resources.yaml" %}}

## How Pods with resource requests are scheduled

When you create a Pod, the Kubernetes scheduler selects a node for the Pod to
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: PodLevelResources
content_type: feature_gate
_build:
list: never
render: false

stages:
- stage: alpha
defaultValue: false
fromVersion: "1.32"
---
Enable _Pod level resources_: the ability to specify resource requests and limits
at the Pod level, rather than only for specific containers.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ kubectl delete namespace constraints-cpu-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ kubectl delete namespace default-cpu-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ kubectl delete namespace constraints-mem-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ kubectl delete namespace default-mem-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ kubectl delete namespace quota-mem-cpu-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ kubectl delete namespace quota-pod-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)


Expand Down
2 changes: 2 additions & 0 deletions content/en/docs/tasks/administer-cluster/quota-api-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ kubectl delete namespace quota-object-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ kubectl delete namespace cpu-example

* [Assign Memory Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-memory-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)

### For cluster administrators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ kubectl delete namespace mem-example

* [Assign CPU Resources to Containers and Pods](/docs/tasks/configure-pod-container/assign-cpu-resource/)

* [Assign Pod-level CPU and memory resources](/docs/tasks/configure-pod-container/assign-pod-level-resources/)

* [Configure Quality of Service for Pods](/docs/tasks/configure-pod-container/quality-service-pod/)

### For cluster administrators
Expand Down
Loading