You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/reference/command-line-tools-reference/feature-gates/InPlacePodLevelResourcesVerticalScaling.md
This page explains how to change the CPU and memory resources set at the Pod level without recreating the Pod.
13
13
14
-
The In-place Pod Resize feature allows modifying resource allocations for a running Pod, avoiding application disruption. The process for resizing individual container resources is covered in the documentation [Resize CPU and Memory Resources assigned to Containers](/docs/tasks/configure-pod-container/resize-container-resources.md).
14
+
The In-place Pod Resize feature allows modifying resource allocations for a running Pod, avoiding application disruption. The process for resizing individual container resources is covered in [Resize CPU and Memory Resources assigned to Containers](/docs/tasks/configure-pod-container/resize-container-resources).
15
15
16
-
This document focuses on the new capability introduced in Kubernetes v1.35: In-place
17
-
Pod-Level Resources Resize. Pod-level resources are defined in spec.resources and
18
-
act as an upper bound constraint on the aggregate resources used by all containers
19
-
within the Pod. In-place Pod-Level Resources Resize feature allows you to change
20
-
these overall aggregate CPU/memory allocations for a running Pod directly.
16
+
This page highlights In-place Pod-level resources resize. Pod-level resources
17
+
are defined in `spec.resources` and they act as the upper bound on the aggregate resources
18
+
consumed by all containers in the Pod. The In-place Pod-level resources resize feature
19
+
lets you change these aggregate CPU and memory allocations for a running Pod directly.
21
20
22
21
## {{% heading "prerequisites" %}}
23
22
24
23
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
25
24
26
-
Your Kubernetes server must be at or later than version 1.35.
27
-
To check the version, enter kubectl version.
25
+
The following [feature gates](/docs/reference/command-line-tools-reference/feature-gates/)
26
+
must be enabled for your control plane and for all nodes in your cluster:
28
27
29
-
The following [feature
30
-
gates](/docs/reference/command-line-tools-reference/feature-gates/) must be enabled
31
-
for your control plane and for all nodes in your cluster:
The kubectl client version must be at least v1.32 to use the
38
-
--subresource=resize flag.
33
+
The kubectl client version must be at least v1.32 to use the `--subresource=resize` flag.
39
34
40
35
## Pod Resize Status and Retry Logic
41
36
42
-
The mechanism the Kubelet uses to track and retry resource changes is shared between container-level and Pod-level resize requests.
37
+
The mechanism the `kubelet` uses to track and retry resource changes is shared between container-level and Pod-level resize requests.
43
38
44
39
The statuses, reasons, and retry priorities are identical to those defined for container resize:
45
40
46
-
* Status Conditions: The Kubelet uses PodResizePending (with reasons like Infeasible or Deferred) and PodResizeInProgress to communicate the state of the request.
41
+
* Status Conditions: The `kubelet` uses PodResizePending (with reasons like Infeasible or Deferred) and PodResizeInProgress to communicate the state of the request.
47
42
48
43
* Retry Priority: Deferred resizes are retried based on PriorityClass, then QoS class (Guaranteed over Burstable), and finally by the duration they have been deferred.
49
44
50
-
* Tracking: You can use the observedGeneration fields to track which Pod specification (metadata.generation) corresponds to the status of the latest processed resize request.
45
+
* Tracking: You can use the `observedGeneration` fields to track which Pod specification (metadata.generation) corresponds to the status of the latest processed resize request.
51
46
52
47
For a full description of these conditions and retry logic, please refer to the [Pod resize status](/docs/tasks/configure-pod-container/resize-container-resources/#pod-resize-status) section in the container resize documentation.
53
48
@@ -126,7 +121,7 @@ You should see:
126
121
*`status.containerStatuses[0].restartCount` remains `0`, because the CPU
127
122
`resizePolicy` was `NotRequired`.
128
123
*`status.containerStatuses[1].restartCount` increased to `1` indicating the
129
-
container was restarted to apply the CPU change. The restart occurred in Container 1 despite the resize being applied at the Pod level, due to the intricate relationship between Pod-level limits and container-level policies. Because Container 1 did not specify an explicit CPU limit, its underlying resource configuration (e.g., cgroups) implicitly adopted the Pod's overall CPU limit as its effective maximum consumption boundary. When the Pod-level CPU limit was patched from 200m to 300m, this action consequently changed the implicit limit enforced on Container 1. Since Container 1 had its resizePolicy explicitly set to RestartContainer for CPU, the Kubelet was obligated to restart the container to correctly apply this change in the underlying resource enforcement mechanism, thus confirming that altering Pod-level limits can trigger container restart policies even when container limits are not directly defined.
124
+
container was restarted to apply the CPU change. The restart occurred in Container 1 despite the resize being applied at the Pod level, due to the intricate relationship between Pod-level limits and container-level policies. Because Container 1 did not specify an explicit CPU limit, its underlying resource configuration (For example, cgroups) implicitly adopted the Pod's overall CPU limit as its effective maximum consumption boundary. When the Pod-level CPU limit was patched from 200m to 300m, this action consequently changed the implicit limit enforced on Container 1. Since Container 1 had its resizePolicy explicitly set to RestartContainer for CPU, the `kubelet` was obligated to restart the container to correctly apply this change in the underlying resource enforcement mechanism, thus confirming that altering Pod-level limits can trigger container restart policies even when container limits are not directly defined.
0 commit comments