Skip to content

Commit 677b491

Browse files
authored
Merge pull request #51729 from natasha41575/ippr-docs
In-place pod resize docs for 1.34
2 parents 41b96ba + 2612fd5 commit 677b491

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

content/en/docs/tasks/configure-pod-container/resize-container-resources.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,28 @@ The Kubelet updates the Pod's status conditions to indicate the state of a resiz
6969
This is usually brief but might take longer depending on the resource type and runtime behavior.
7070
Any errors during actuation are reported in the `message` field (along with `reason: Error`).
7171

72+
### How kubelet retries Deferred resizes
73+
74+
If the requested resize is _Deferred_, the kubelet will periodically re-attempt the resize,
75+
for example when another pod is removed or scaled down. If there are multiple deferred
76+
resizes, they are retried according to the following priority:
77+
78+
* Pods with a higher Priority (based on PriorityClass) will have their resize request retried first.
79+
* If two pods have the same Priority, resize of guaranteed pods will be retried before the resize of burstable pods.
80+
* If all else is the same, pods that have been in the Deferred state longer will be prioritized.
81+
82+
A higher priority resize being marked as pending will not block the remaining pending resizes from being attempted;
83+
all remaining pending resizes will still be retried even if a higher-priority resize gets deferred again.
84+
85+
86+
### Leveraging `observedGeneration` Fields
87+
88+
{{< feature-state feature_gate_name="PodObservedGenerationTracking" >}}
89+
90+
* The top-level `status.observedGeneration` field shows the `metadata.generation` corresponding to the latest pod specification that the kubelet has acknowledged. You can use this to determine the most recent resize request the kubelet has processed.
91+
* In the `PodResizeInProgress` condition, the `conditions[].observedGeneration` field indicates the `metadata.generation` of the podSpec when the current in-progress resize was initiated.
92+
* In the `PodResizePending` condition, the `conditions[].observedGeneration` field indicates the `metadata.generation` of the podSpec when the pending resize's allocation was last attempted.
93+
7294
## Container resize policies
7395

7496
You can control whether a container should be restarted when resizing
@@ -107,8 +129,11 @@ Consider a container configured with `restartPolicy: NotRequired` for CPU and `r
107129
For Kubernetes {{< skew currentVersion >}}, resizing pod resources in-place has the following limitations:
108130

109131
* **Resource Types:** Only CPU and memory resources can be resized.
110-
* **Memory Decrease:** Memory limits _cannot be decreased_ unless the `resizePolicy` for memory is `RestartContainer`.
111-
Memory requests can generally be decreased.
132+
* **Memory Decrease:** If the memory resize restart policy is `NotRequired` (or unspecified), the kubelet will make a
133+
best-effort attempt to prevent oom-kills when decreasing memory limits, but doesn't provide any guarantees.
134+
Before decreasing container memory limits, if memory usage exceeds the requested limit, the resize will be skipped
135+
and the status will remain in an "In Progress" state. This is considered best-effort because it is still subject
136+
to a race condition where memory usage may spike right after the check is performed.
112137
* **QoS Class:** The Pod's original [Quality of Service (QoS) class](/docs/concepts/workloads/pods/pod-qos/)
113138
(Guaranteed, Burstable, or BestEffort) is determined at creation and **cannot** be changed by a resize.
114139
The resized resource values must still adhere to the rules of the original QoS class:

0 commit comments

Comments
 (0)