Skip to content

Commit 2062c22

Browse files
committed
KEP-1287: Address PR feedback
1 parent 3bcbdde commit 2062c22

File tree

1 file changed

+17
-14
lines changed
  • keps/sig-node/1287-in-place-update-pod-resources

1 file changed

+17
-14
lines changed

keps/sig-node/1287-in-place-update-pod-resources/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,10 @@ PodStatus is extended to show the resources applied to the Pod and its Container
219219
* Pod.Status.ContainerStatuses[i].Resources (new field, type
220220
v1.ResourceRequirements) shows the **actual** resources held by the Pod and
221221
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)).
225226

226227
The actual resources are reported by the container runtime in some cases, and for all other
227228
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
276277
can mark Containers as safe (or unsafe) for in-place resource update. Kubelet
277278
uses it to determine the required action.
278279

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.
281284

282285
Setting the flag to separately control CPU & memory is due to an observation
283286
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.
328331
As of Kubernetes v1.20, the CRI has included support for in-place resizing of containers via the
329332
`UpdateContainerResources` API, which is implemented by both containerd and CRI-O. Additionally, the
330333
`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
332335
same configuration multiple times.
333336

334337
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
449452
being resized, it adds the new desired resources (i.e
450453
Spec.Containers[i].Resources.Requests) to the sum.
451454

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.
458459
* If new desired resources don't fit, Kubelet will add the `PodResizePending` condition with type
459460
`Infeasible` and a message explaining why.
460461
* 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.
850851

851852
Pod v1 core API:
852853
* extend API
853-
* auto-reset Status.Resize on changes to Resources
854854
* added validation allowing only CPU and memory resource changes
855855

856856
Admission Controllers: LimitRanger, ResourceQuota need to support Pod Updates:
@@ -864,7 +864,8 @@ Admission Controllers: LimitRanger, ResourceQuota need to support Pod Updates:
864864
Kubelet:
865865
* set Pod's Status.ContainerStatuses[i].Resources for Containers upon placing
866866
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
868869
* change UpdateContainerResources CRI API to work for both Linux & Windows.
869870

870871
Scheduler:
@@ -897,6 +898,8 @@ This will be reconsidered post-beta as a future enhancement.
897898
update to running Pods.
898899
1. Allow resizing local ephemeral storage.
899900
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.
900903

901904
#### Mutable QOS Class "Shape"
902905

0 commit comments

Comments
 (0)