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 @@ -113,21 +113,24 @@ resource requests/limits of that type for each container in the Pod.

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

Starting in Kubernetes 1.32, you can also specify resource requests and limits at
Provided your cluster has the `PodLevelResources`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) enabled,
you can specify resource requests and limits at
the Pod level. At the 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.
or `memory` and / or `hugepages`. With this feature, 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.limits.hugepages-<size>`
* `spec.resources.requests.cpu`
* `spec.resources.requests.memory`
* `spec.resources.requests.hugepages-<size>`

## Resource units in Kubernetes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ stages:
- stage: alpha
defaultValue: false
fromVersion: "1.32"
toVersion: "1.33"
- stage: beta
defaultValue: true
fromVersion: "1.34"
---
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 @@ -2,7 +2,7 @@
title: Assign Pod-level CPU and memory resources
content_type: task
weight: 30
min-kubernetes-server-version: 1.32
min-kubernetes-server-version: 1.34
---


Expand Down Expand Up @@ -43,6 +43,23 @@ The `PodLevelResources` [feature
gate](/docs/reference/command-line-tools-reference/feature-gates/) must be enabled
for your control plane and for all nodes in your cluster.

## Limitations

For Kubernetes {{< skew currentVersion >}}, resizing pod-level resources has the
following limitations:

* **Resource Types:** Only CPU, memory and hugepages resources can be specified at pod-level.
* **Operating System:** Pod-level resources are not supported for Windows
pods.
* **Resource Managers:** The Topology Manager, Memory Manager and CPU Manager do not
align pods and containers based on pod-level resources as these resource managers
don't currently support pod-level resources.
* **[In-Place
Resize](https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/):**
In-place resize of pod-level resources is not supported. Modifying the pod-level resource
limits or requests on a pod result in a field.Forbidden error. The error message
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: would it actually be a 400 response?

explicitly states, "pods with pod-level resources cannot be resized."

<!-- steps -->

## Create a namespace
Expand Down