You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vertical-pod-autoscaler/enhancements/7862-cpu-startup-boost/README.md
+33-20Lines changed: 33 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ pod (re-)creation time.
47
47
* Allow VPA to scale pods down [in-place](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/1287-in-place-update-pod-resources)
48
48
to the existing VPA recommendation for that container, if any, or to the CPU
49
49
resources configured in the pod spec, as soon as their [`Ready`](https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-conditions)
50
-
condition is true and `StartupBoost.CPU.Duration` has elapsed.
50
+
condition is true and `StartupBoost.CPU.DurationSeconds` has elapsed.
51
51
52
52
### Non-Goals
53
53
@@ -79,13 +79,23 @@ VPA object) without having to ALSO use the traditional VPA functionality.
79
79
1. When a pod targeted by that VPA is created, the kube-apiserver invokes the
80
80
VPA Admission Controller
81
81
82
-
1. The VPA Admission Controller modifies the pod's containers CPU request and
83
-
limits to align with its `StartupBoost` policy, if specified, during the pod
84
-
creation. The boosted value is based on the VPA recommendation available at the
85
-
time of admission. During the boost period, no resizing will take place.
82
+
83
+
1. The VPA Admission Controller modifies the pod's containers CPU request and
84
+
limits to align with its `StartupBoost` policy, if specified, during the pod
85
+
creation. The base value for the boost calculation is the VPA recommended CPU
86
+
request. If the VPA recommendation is not available or is zero, the container's
87
+
original CPU request from the Pod spec is used as the base.
88
+
89
+
The behavior for CPU limits depends on the `ControlledValues` setting in the
90
+
`ContainerResourcePolicy`:
91
+
92
+
* If `ControlledValues` is `RequestsOnly` , the boosted CPU request
93
+
will be capped just below the container's original CPU limit(to preserve pod QoS), if one is set.
94
+
* If `ControlledValues` is `RequestsAndLimits` (the default), the CPU limit is also boosted.
95
+
The new limit is calculated to maintain the container's original limit-to-request ratio, applied to the new boosted CPU request. In cases where this ratio cannot be established (e.g., if the original CPU limit was unspecified), the limit will not be changed by the boost.
86
96
87
97
1. The VPA Updater monitors pods targeted by the VPA object and when the pod
88
-
condition is `Ready` and `StartupBoost.CPU.Duration` has elapsed, it scales
98
+
condition is `Ready` and `StartupBoost.CPU.DurationSeconds` has elapsed, it scales
89
99
down the CPU resources to the appropriate non-boosted value. This "unboosting"
90
100
resizes the pod to whatever the recommendation is at that moment. The specific
> [Readiness or a Startup probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
166
179
> for the containers that will be CPU boosted. Check the [Test Plan](#test-plan)
167
180
> section for more details on this feature's behavior for different combinations
168
-
> of probers + `StartupBoost.CPU.Duration`.
181
+
> of probers + `StartupBoost.CPU.DurationSeconds`.
169
182
170
183
#### Priority of `StartupBoost`
171
184
@@ -255,18 +268,18 @@ Other than comprehensive unit tests, we will also add the following scenarios to
255
268
our e2e tests:
256
269
257
270
* CPU Startup Boost recommendation is applied to pod controlled by VPA until it
258
-
becomes `Ready` and `StartupBoost.CPU.Duration` has elapsed. Then, the pod is
271
+
becomes `Ready` and `StartupBoost.CPU.DurationSeconds` has elapsed. Then, the pod is
259
272
scaled back down in-place. We'll also test the following sub-cases:
260
273
* Boost is applied to all containers of a pod.
261
274
* Boost is applied only to a subset of containers in a pod.
262
-
* Combinations of probes + `StartupBoost.CPU.Duration`:
263
-
* No probes and no `StartupBoost.CPU.Duration` specified: unboost will
275
+
* Combinations of probes + `StartupBoost.CPU.DurationSeconds`:
276
+
* No probes and no `StartupBoost.CPU.DurationSeconds` specified: unboost will
264
277
likely happen immediately.
265
-
* No probes and a 60s `StartupBoost.CPU.Duration`: unboost will likely
278
+
* No probes and a 60s `StartupBoost.CPU.DurationSeconds`: unboost will likely
266
279
happen after 60s.
267
-
* A readiness/startup probe and no `StartupBoost.CPU.Duration` specified:
280
+
* A readiness/startup probe and no `StartupBoost.CPU.DurationSeconds` specified:
268
281
unboost will likely as soon as the pod becomes `Ready`.
269
-
* A readiness/startup probe and a 60s `StartupBoost.CPU.Duration`
282
+
* A readiness/startup probe and a 60s `StartupBoost.CPU.DurationSeconds`
270
283
specified: unboost will likely happen 60s **after** the pod becomes `Ready`.
271
284
272
285
* Pod is not evicted if the in-place update fails when scaling the pod back
@@ -299,7 +312,7 @@ spec:
299
312
cpu:
300
313
type: "Factor"
301
314
factor: 3
302
-
duration: 10s
315
+
durationSeconds: 10
303
316
```
304
317
305
318
#### Startup CPU Boost Disabled & VPA Enabled
@@ -336,7 +349,7 @@ spec:
336
349
cpu:
337
350
type: "Factor"
338
351
factor: 3
339
-
duration: 10s
352
+
durationSeconds: 10
340
353
```
341
354
342
355
### Per-container configurations (`startupBoost` configured in `ContainerPolicies`)
@@ -436,10 +449,10 @@ spec:
436
449
437
450
## Implementation History
438
451
452
+
* 2026-02-02: Change `startupBoost.cpu.duration` to `startupBoost.cpu.durationSeconds` and its type from string to int32 (seconds).
439
453
* 2025-10-04: Update `startupBoost.cpu.type` field to correctly indicate it is a required field, not optional. The field has no default value and must be explicitly set to either "Factor" or "Quantity".
440
454
* 2025-08-05: Make some API changes and clarify behavior during and after boost period in the workflow section.
441
455
* 2025-06-23: Decouple Startup CPU Boost from InPlaceOrRecreate mode, allow
442
456
users to specify a `startupBoost` config in `VerticalPodAutoscalerSpec` and in
443
457
`ContainerPolicies`to make the API simpler and add more yaml examples.
0 commit comments