@@ -219,9 +219,10 @@ PodStatus is extended to show the resources applied to the Pod and its Container
219
219
* Pod.Status.ContainerStatuses[ i] .Resources (new field, type
220
220
v1.ResourceRequirements) shows the ** actual** resources held by the Pod and
221
221
its Containers for running containers, and the allocated resources for non-running containers.
222
- * Pod.Status.ContainerStatuses[ i] .AllocatedResources (new field) reports the allocated resource requests.
223
- * Pod.Status.Resize (new field, type map[ string] string) explains what is
224
- happening for a given resource on a given container.
222
+ * Pod.Status.ContainerStatuses[ i] .AllocatedResources (new field, type v1.ResourceList) reports the
223
+ allocated resource requests.
224
+ * Pod.Status.Conditions explain what is happening for a given resource on a given container (see
225
+ details [ below] ( #resize-status ) ).
225
226
226
227
The actual resources are reported by the container runtime in some cases, and for all other
227
228
resources are copied from the latest snapshot of allocated resources. Currently, the resources
@@ -276,8 +277,10 @@ ResizeRestartPolicy - a list of named subobjects (new object) that supports
276
277
can mark Containers as safe (or unsafe) for in-place resource update. Kubelet
277
278
uses it to determine the required action.
278
279
279
- Note: ` PreferNoRestart ` restart policy for resize does not * guarantee* that a container
280
- won't be restarted.
280
+ Note: ` PreferNoRestart ` restart policy for resize does not * guarantee* that a container won't be
281
+ restarted. If the runtime knows a resize will trigger a restart, it should return an error instead,
282
+ and the Kubelet will retry the resize on the next pod sync. The restart behavior when shrinking
283
+ memory limits is not yet defined.
281
284
282
285
Setting the flag to separately control CPU & memory is due to an observation
283
286
that usually CPU can be added/removed without much problem whereas changes to
@@ -328,7 +331,7 @@ will be deprecated, and not graduate to beta.
328
331
As of Kubernetes v1.20, the CRI has included support for in-place resizing of containers via the
329
332
` UpdateContainerResources ` API, which is implemented by both containerd and CRI-O. Additionally, the
330
333
` ContainerStatus ` message includes a ` ContainerResources ` field, which reports the current resource
331
- configuration of the container. ` UpdateContainerResources ` should be idempotent, if called with the
334
+ configuration of the container. ` UpdateContainerResources ` must be idempotent, if called with the
332
335
same configuration multiple times.
333
336
334
337
Starting with Kubernetes v1.33, the contract on the ` UpdateContainerResources ` call will be updated
@@ -449,12 +452,10 @@ allocated for all Pods in the Node, except the Pod being resized. For the Pod
449
452
being resized, it adds the new desired resources (i.e
450
453
Spec.Containers[ i] .Resources.Requests) to the sum.
451
454
452
- * If new desired resources fit, Kubelet accepts the resize, updates
453
- the allocated resources, and sets Status.Resize to
454
- "InProgress". It then invokes the UpdateContainerResources CRI API to update
455
- Container resource limits. Once all Containers are successfully updated, it
456
- updates Status...Resources to reflect new resource values and unsets
457
- Status.Resize.
455
+ * If new desired resources fit, Kubelet accepts the resize, updates the allocated resources, and
456
+ adds the ` PodResizeInProgress ` condition. It then invokes the UpdateContainerResources CRI API to update
457
+ Container resource limits. Once all Containers are successfully updated, it updates
458
+ Status...Resources to reflect new resource values and removes the condition.
458
459
* If new desired resources don't fit, Kubelet will add the ` PodResizePending ` condition with type
459
460
` Infeasible ` and a message explaining why.
460
461
* If new desired resources fit but are in-use at the moment, Kubelet will add the ` PodResizePending `
@@ -850,7 +851,6 @@ pod updates where `.status...resources` changed.
850
851
851
852
Pod v1 core API:
852
853
* extend API
853
- * auto-reset Status.Resize on changes to Resources
854
854
* added validation allowing only CPU and memory resource changes
855
855
856
856
Admission Controllers: LimitRanger, ResourceQuota need to support Pod Updates:
@@ -864,7 +864,8 @@ Admission Controllers: LimitRanger, ResourceQuota need to support Pod Updates:
864
864
Kubelet:
865
865
* set Pod's Status.ContainerStatuses[ i] .Resources for Containers upon placing
866
866
a new Pod on the Node,
867
- * update Pod's Status.Resize and Status...AllocatedResources upon resize,
867
+ * update Pod's Status...AllocatedResources and Status...Resources upon resize,
868
+ * manage the new ` PodResizePending ` and ` PodResizeInProgress ` conditions
868
869
* change UpdateContainerResources CRI API to work for both Linux & Windows.
869
870
870
871
Scheduler:
@@ -897,6 +898,8 @@ This will be reconsidered post-beta as a future enhancement.
897
898
update to running Pods.
898
899
1 . Allow resizing local ephemeral storage.
899
900
1 . Handle pod-scoped resources (https://github.com/kubernetes/enhancements/pull/1592 )
901
+ 1 . Explore periodic resyncing of resources. That is, periodically issue resize requests to the
902
+ runtime even if the allocated resources haven't changed.
900
903
901
904
#### Mutable QOS Class "Shape"
902
905
0 commit comments