@@ -84,13 +84,20 @@ VPA Admission Controller
84
84
85
85
1 . The VPA Admission Controller modifies the pod's containers CPU request and
86
86
limits to align with its ` StartupBoost ` policy, if specified, during the pod
87
- creation.
87
+ creation. The boosted value is based on the VPA recommendation available at the
88
+ time of admission. During the boost period, no resizing will take place.
88
89
89
90
1 . The VPA Updater monitors pods targeted by the VPA object and when the pod
90
- condition is ` Ready ` and ` StartupBoost.CPU.Duration ` has elapsed, it scales
91
- down the CPU resources to the appropriate non-boosted value:
92
- ` existing VPA recommendation for that container ` (if any) OR the
93
- ` CPU resources configured in the pod spec ` .
91
+ condition is ` Ready ` and ` StartupBoost.CPU.Duration ` has elapsed, it scales
92
+ down the CPU resources to the appropriate non-boosted value. This "unboosting"
93
+ resizes the pod to whatever the recommendation is at that moment. The specific
94
+ behavior is determined by the VPA ` updatePolicy ` :
95
+ * If ` updatePolicy ` is ` Auto ` , ` Recreate ` or ` InPlaceOrRecreate ` , the VPA
96
+ Updater will apply the current VPA recommendation, even if it's higher than
97
+ the boosted value.
98
+ * If ` updatePolicy ` is ` Off ` for the VPA object, or ` mode ` is ` Off ` in a
99
+ container policy, the VPA Updater will revert the CPU resources to the
100
+ values specified in the pod spec.
94
101
* The scale down is applied [ in-place] ( https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/1287-in-place-update-pod-resources ) .
95
102
96
103
### API Changes
@@ -101,22 +108,52 @@ The new `StartupBoost` parameter will be added to both:
101
108
* [ ` ContainerResourcePolicy ` ] ( https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler-1.3.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L191 ) :
102
109
Will allow users to optionally customize the startup boost behavior for individual containers.
103
110
111
+ Here is the Go struct definition for ` CPUStartupBoost ` :
112
+
113
+ ``` go
114
+ // +enum
115
+ type CPUBoostType string
116
+
117
+ const (
118
+ FactorType CPUBoostType = " Factor"
119
+ QuantityType CPUBoostType = " Quantity"
120
+ )
121
+
122
+ type CPUStartupBoost struct {
123
+ // +unionDiscriminator
124
+ // +required
125
+ Type CPUBoostType ` json:"type"`
126
+
127
+ // +unionMember=Factor
128
+ // +optional
129
+ Factor *int32 ` json:"factor,omitempty"`
130
+
131
+ // +unionMember=Quantity
132
+ // +optional
133
+ Quantity *resource.Quantity ` json:"quantity,omitempty"`
134
+
135
+ // +optional
136
+ Duration *metav1.Duration ` json:"duration,omitempty"`
137
+ }
138
+ ```
139
+
104
140
` StartupBoost ` will contain the following fields:
105
141
* [ Optional] ` StartupBoost.CPU.Type ` (type: ` string ` ): A string that specifies
106
142
the kind of boost to apply. Supported values are:
107
- * ` Factor ` : The ` StartupBoost.CPU.Value ` field will be interpreted as a
143
+ * ` Factor ` : The ` StartupBoost.CPU.Factor ` field will be interpreted as a
108
144
multiplier for the recommended CPU request. For example, a value of ` 2 ` will
109
145
double the CPU request.
110
- * ` Quantity ` : The ` StartupBoost.CPU.Value ` field will be interpreted as an
146
+ * ` Quantity ` : The ` StartupBoost.CPU.Quantity ` field will be interpreted as an
111
147
absolute CPU resource quantity (e.g., ` "500m" ` , ` "1" ` ) to be used as the CPU
112
148
request or limit during the boost phase.
113
149
* If not specified, ` StartupBoost.CPU.Type ` defaults to ` Factor ` .
114
150
115
- * ` StartupBoost.CPU.Value ` : (type: ` string ` ): A string representing the
116
- magnitude of the boost, interpreted based on the ` StartupBoost.CPU.Type ` .
117
- * If ` StartupBoost.CPU.Type ` is ` Factor ` , this field is optional and
118
- defaults to ` "1" ` .
151
+ * [ Optional ] ` StartupBoost.CPU.Factor ` : (type: ` integer ` ): The factor to apply to the CPU request. Defaults to 1 if not specified.
152
+ * If ` StartupBoost.CPU.Type ` is ` Factor ` , this field is required .
153
+ * If ` StartupBoost.CPU.Type ` is ` Quantity ` , this field is not allowed.
154
+ * [ Optional ] ` StartupBoost.CPU.Quantity ` : (type: ` resource.Quantity ` ): The absolute CPU resource quantity .
119
155
* If ` StartupBoost.CPU.Type ` is ` Quantity ` , this field is required.
156
+ * If ` StartupBoost.CPU.Type ` is ` Factor ` , this field is not allowed.
120
157
* [ Optional] ` StartupBoost.CPU.Duration ` (type: ` duration ` ): if specified, it
121
158
indicates for how long to keep the pod boosted ** after** it goes to ` Ready ` .
122
159
* It defaults to ` 0s ` if not specified.
@@ -264,7 +301,7 @@ spec:
264
301
updateMode : " Off"
265
302
startupBoost :
266
303
cpu :
267
- value : " 3 "
304
+ factor : 3
268
305
duration : 10s
269
306
` ` `
270
307
@@ -300,7 +337,7 @@ spec:
300
337
updateMode : " Auto"
301
338
startupBoost :
302
339
cpu :
303
- value : " 3 "
340
+ factor : 3
304
341
duration : 10s
305
342
` ` `
306
343
@@ -333,7 +370,7 @@ spec:
333
370
startupBoost:
334
371
cpu:
335
372
type: "Quantity"
336
- value : "2"
373
+ quantity : "2"
337
374
` ` `
338
375
339
376
# ### Startup CPU Boost Disabled & VPA Enabled
@@ -355,13 +392,13 @@ spec:
355
392
name: example
356
393
startupBoost:
357
394
cpu:
358
- value: "2"
395
+ factor: 2
359
396
resourcePolicy:
360
397
containerPolicies:
361
398
- containerName: "disable-cpu-boost-for-this-container"
362
399
startupBoost:
363
400
cpu:
364
- value: "1"
401
+ factor: 1
365
402
` ` `
366
403
367
404
# ### Startup CPU Boost Enabled & VPA Enabled
@@ -394,11 +431,12 @@ spec:
394
431
startupBoost:
395
432
cpu:
396
433
type: "Quantity"
397
- value : "4"
434
+ quantity : "4"
398
435
` ` `
399
436
400
437
# # Implementation History
401
438
439
+ * 2025-08-05: Make some API changes and clarify behavior during and after boost period in the workflow section.
402
440
* 2025-06-23: Decouple Startup CPU Boost from InPlaceOrRecreate mode, allow
403
441
users to specify a `startupBoost` config in `VerticalPodAutoscalerSpec` and in
404
442
` ContainerPolicies` to make the API simpler and add more yaml examples.
0 commit comments