Skip to content

Commit 2612fd5

Browse files
committed
ippr: document how to leverage observedGeneration to understand the status
1 parent 08fa7a9 commit 2612fd5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The Kubelet updates the Pod's status conditions to indicate the state of a resiz
7171

7272
### How kubelet retries Deferred resizes
7373

74-
If the requested resize is 'Deferred', the kubelet will periodically re-attempt the resize,
74+
If the requested resize is _Deferred_, the kubelet will periodically re-attempt the resize,
7575
for example when another pod is removed or scaled down. If there are multiple deferred
7676
resizes, they are retried according to the following priority:
7777

@@ -82,6 +82,15 @@ resizes, they are retried according to the following priority:
8282
A higher priority resize being marked as pending will not block the remaining pending resizes from being attempted;
8383
all remaining pending resizes will still be retried even if a higher-priority resize gets deferred again.
8484

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+
8594
## Container resize policies
8695

8796
You can control whether a container should be restarted when resizing
@@ -120,7 +129,7 @@ Consider a container configured with `restartPolicy: NotRequired` for CPU and `r
120129
For Kubernetes {{< skew currentVersion >}}, resizing pod resources in-place has the following limitations:
121130

122131
* **Resource Types:** Only CPU and memory resources can be resized.
123-
* **Memory Decrease:** If the memory resize restart policy is `NotRequired` (or unspecified), the Kubelet will make a
132+
* **Memory Decrease:** If the memory resize restart policy is `NotRequired` (or unspecified), the kubelet will make a
124133
best-effort attempt to prevent oom-kills when decreasing memory limits, but doesn't provide any guarantees.
125134
Before decreasing container memory limits, if memory usage exceeds the requested limit, the resize will be skipped
126135
and the status will remain in an "In Progress" state. This is considered best-effort because it is still subject

0 commit comments

Comments
 (0)