Skip to content

Commit 7db96f6

Browse files
authored
Merge pull request #5266 from natasha41575/prioritized-resizes
KEP-1287: Priority of Resize Requests
2 parents 37424a0 + 88009fc commit 7db96f6

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Risks and Mitigations](#risks-and-mitigations)
2020
- [Design Details](#design-details)
2121
- [Resource States](#resource-states)
22+
- [Priority of Resize Requests](#priority-of-resize-requests)
2223
- [Kubelet and API Server Interaction](#kubelet-and-api-server-interaction)
2324
- [Kubelet Restart Tolerance](#kubelet-restart-tolerance)
2425
- [Scheduler and API Server Interaction](#scheduler-and-api-server-interaction)
@@ -432,6 +433,36 @@ Changes are always propogated through these 4 resource states in order:
432433
Desired --> Allocated --> Actuated --> Actual
433434
```
434435

436+
### Priority of Resize Requests
437+
438+
Resize requests detected by the kubelet (in `HandlePodUpdates` and `HandlePodAdditions`)
439+
will be added to a queue of pending resizes. Resize requests will be attempted according to
440+
the following priority:
441+
442+
1. *Resource requests are not increasing*: Resizes that don't increase requests will be
443+
prioritized first. These resizes are expected to always succeed and would not be marked as
444+
pending.
445+
2. *PriorityClass*: Pods with a higher PriorityClass.
446+
3. *QoS Class*: Pods with a higher QoS class, where Guaranteed > Burstable. Best effort pods
447+
do not have CPU or memory resources, so are excluded from the discussion here.
448+
4. *Time since resize request*: If all else is the same, resizes that have been pending
449+
longer will be retried first (leveraging LastTransitionTime on the PodResizePending condition).
450+
451+
These priorities are *only* used to indicate which resize requests will be attempted first.
452+
Scheduler preemption/eviction to make room for pending resizes is not in scope.
453+
454+
A higher priority resize being marked as pending should not block the remaining pending resizes
455+
from being attempted, i.e. we will try all remaining resizes in the queue even if one is unsuccessful.
456+
Resizes that are deferred will be added back to the queue to be re-attempted later. Resizes that are
457+
infeasible may never be retried.
458+
459+
Allocation will be attempted on the pods in the queue:
460+
- At the end of `HandlePodUpdates`, `HandlePodRemoves`, and `HandlePodCleanups` when a change to the queue is detected.
461+
- Upon completion of another resize request.
462+
- Periodically, to catch any cases that we may have missed.
463+
464+
A successful allocation will trigger a pod sync, which will actuate the allocated resize and update the
465+
pod status accordingly.
435466

436467
### Kubelet and API Server Interaction
437468

@@ -907,7 +938,6 @@ This will be reconsidered post-beta as a future enhancement.
907938
1. Explore periodic resyncing of resources. That is, periodically issue resize requests to the
908939
runtime even if the allocated resources haven't changed.
909940
1. Allow resizing containers with swap allocated.
910-
1. Prioritize resizes when resources are freed, or at least make ordering deterministic.
911941

912942
#### Mutable QOS Class "Shape"
913943

keps/sig-node/1287-in-place-update-pod-resources/kep.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ authors:
66
- "@schylek"
77
- "@vinaykul"
88
- "@tallclair"
9+
- "@natasha41575"
910
owning-sig: sig-node
1011
participating-sigs:
1112
- sig-autoscaling

0 commit comments

Comments
 (0)