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
@@ -38,10 +38,6 @@ the pod startup and to scale the CPU resources back down when the pod is
38
38
`Ready` or after certain time has elapsed, leveraging the
39
39
[in-place pod resize Kubernetes feature](https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/1287-in-place-update-pod-resources).
40
40
41
-
> [!NOTE]
42
-
> This feature depends on the new `InPlaceOrRecreate` VPA mode:
43
-
> [AEP-4016: Support for in place updates in VPA](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/enhancements/4016-in-place-updates-support/README.md)
44
-
45
41
### Goals
46
42
47
43
* Allow VPA to boost the CPU request and limit of a pod's containers during the
@@ -61,17 +57,16 @@ time.
61
57
62
58
## Proposal
63
59
64
-
* To extend [`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)
60
+
* To extend [`VerticalPodAutoscalerSpec`](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler-1.3.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L75)
65
61
with a new `StartupBoost` field to allow users to configure the CPU startup
66
62
boost.
67
63
68
-
* To extend [`ContainerScalingMode`](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler-1.3.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L231-L236)
69
-
with a new `StartupBoostOnly` mode to allow users to only enable the startup
70
-
boost feature and not vanilla VPA altogether.
64
+
* To extend [`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)
65
+
with a new `StartupBoost` field to allow users to optionally customize the
66
+
startup boost behavior for individual containers.
71
67
72
-
* To allow CPU startup boost if a `StartupBoost` config is specified in `Auto`
* To enable only startup boost (if the `StartupBoost` config is present in the
69
+
VPA object) without having to ALSO use the traditional VPA functionality.
75
70
76
71
## Design Details
77
72
@@ -95,8 +90,15 @@ down the CPU resources to the appropriate non-boosted value:
95
90
96
91
### API Changes
97
92
98
-
The new `StartupBoost` parameter will be added to the [`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)
99
-
and contain the following fields:
93
+
The new `StartupBoost` parameter will be added to both:
Will allow users to optionally customize the startup boost behavior for individual containers.
98
+
99
+
`StartupBoost` will contain the following fields:
100
+
*[Optional]`StartupBoost.CPU.Mode`: whether CPU boost is enabled (`"Auto"`)
101
+
or not (`"Off"`). If not specified, it defaults to `"Auto"`.
100
102
*`StartupBoost.CPU.Factor`: the factor by which to multiply the initial
101
103
resource request and limit of the containers' targeted by the VPA object.
102
104
*`StartupBoost.CPU.Value`: the target value of the CPU request or limit
@@ -121,22 +123,15 @@ and contain the following fields:
121
123
> section for more details on this feature's behavior for different combinations
122
124
> of probers + `StartupBoost.CPU.Duration`.
123
125
124
-
We will also add a new mode to the [`ContainerScalingMode`](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler-1.3.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L231-L236):
125
-
***NEW**: `StartupBoostOnly`: new mode that will allow users to only enable
126
-
the startup boost feature for a container and not vanilla VPA altogether.
127
-
***NEW**: `Auto`: we will modify the existing `Auto` mode to enable both
128
-
vanilla VPA and CPU Startup Boost (when `StartupBoost` parameter is
129
-
specified).
130
-
131
126
#### Priority of `StartupBoost`
132
127
133
-
The new `StartupBoost` field will take precedence over the rest of the container
134
-
resource policy configurations. Functioning independently from all other fields
The new `StartupBoost` field will take precedence over the rest of the fields
129
+
in [`VerticalPodAutoscalerSpec`](https://github.com/kubernetes/autoscaler/blob/vertical-pod-autoscaler-1.3.0/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go#L75)
@@ -149,12 +144,11 @@ excluded from [`ControlledResources`](https://github.com/kubernetes/autoscaler/b
149
144
150
145
* We will check that the `startupBoost` configuration is valid when VPA objects
151
146
are created/updated:
152
-
* The VPA autoscaling mode must be `InPlaceOrRecreate` (since it does not
153
-
make sense to use this feature with disruptive modes of VPA).
154
147
* The boost factor is >= 1 (via CRD validation rules)
155
148
* Only one of `StartupBoost.CPU.Factor` or `StartupBoost.CPU.Value` is
156
149
specified
157
-
* The [feature enablement](#feature-enablement) flags must be on.
150
+
* The [feature enablement](#feature-enablement-and-rollback) flags must be
151
+
on.
158
152
159
153
160
154
#### Dynamic Validation
@@ -166,7 +160,7 @@ are created/updated:
166
160
167
161
The VPA Updater **will not** evict a pod if it attempted to scaled the pod down
168
162
in place (to unboost its CPU resources) and the update failed (see the
169
-
[scenarios](https://github.com/kubernetes/autoscaler/blob/0a34bf5d3a71b486bdaa440f1af7f8d50dc8e391/vertical-pod-autoscaler/enhancements/4016-in-place-updates-support/README.md?plain=1#L164-L169) where the VPA
163
+
[scenarios](https://github.com/kubernetes/autoscaler/blob/0a34bf5d3a71b486bdaa440f1af7f8d50dc8e391/vertical-pod-autoscaler/enhancements/4016-in-place-updates-support/README.md?plain=1#L164-L169) where the VPA
170
164
updater will consider that the update failed). This is to avoid an eviction
171
165
loop:
172
166
@@ -179,37 +173,33 @@ the pod in-place and it fails.
179
173
180
174
#### How can this feature be enabled / disabled in a live cluster?
181
175
182
-
* Feature gates names: `CPUStartupBoost` and `InPlaceOrRecreate` (from
Enabling of feature gates `CPUStartupBoost` AND `InPlaceOrRecreate` will cause
189
-
the following to happen:
181
+
Enabling of feature gates `CPUStartupBoost` will cause the following to happen:
190
182
* admission-controller to **accept** new VPA objects being created with
191
-
`StartupBoostOnly` configured.
183
+
`StartupBoost` configured.
192
184
* admission-controller to **boost** CPU resources.
193
185
* updater to **unboost** the CPU resources.
194
186
195
-
Disabling of feature gates `CPUStartupBoost` OR `InPlaceOrRecreate` will cause
196
-
the following to happen:
187
+
Disabling of feature gates `CPUStartupBoost` will cause the following to happen:
197
188
* admission-controller to **reject** new VPA objects being created with
198
-
`StartupBoostOnly` configured.
189
+
`StartupBoost` configured.
199
190
* A descriptive error message should be returned to the user letting them
200
191
know that they are using a feature gated feature.
201
192
* admission-controller **to not** boost CPU resources, should it encounter a
202
-
VPA configured with a `StartupBoost` config and `StartupBoostOnly` or `Auto`
203
-
`ContainerScalingMode`.
193
+
VPA configured with a `StartupBoost` config.
204
194
* updater **to not** unboost CPU resources when pods meet the scale down
205
195
requirements, should it encounter a VPA configured with a `StartupBoost`
206
-
config and `StartupBoostOnly` or `Auto``ContainerScalingMode`.
196
+
config.
207
197
208
198
### Kubernetes Version Compatibility
209
199
210
200
Similarly to [AEP-4016](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/enhancements/4016-in-place-updates-support#kubernetes-version-compatibility),
211
-
`StartupBoost` configuration and `StartupBoostOnly` mode are built assuming that
212
-
VPA will be running on a Kubernetes 1.33+ with the beta version of
201
+
`StartupBoost` configuration is built assuming that VPA will be running on a
202
+
Kubernetes 1.33+ with the beta version of
213
203
[KEP-1287: In-Place Update of Pod Resources](https://github.com/kubernetes/enhancements/issues/1287)
214
204
enabled. If this is not the case, VPA's attempt to unboost pods may fail and the
215
205
pods may remain boosted for their whole lifecycle.
@@ -242,11 +232,47 @@ down.
242
232
Here are some examples of the VPA CR incorporating CPU boosting for different
243
233
scenarios.
244
234
245
-
### CPU Boost Only
235
+
### Per-pod configurations (`startupBoost` configured in `VerticalPodAutoscalerSpec`)
246
236
247
-
All containers under `example` deployment will receive "regular" VPA updates,
248
-
**except for**`boosted-container-name`. `boosted-container-name` will only be
249
-
CPU boosted/unboosted, because it has a `StartupBoostOnly` container policy.
237
+
#### Startup CPU Boost Enabled & VPA Disabled
238
+
239
+
```yaml
240
+
apiVersion: "autoscaling.k8s.io/v1"
241
+
kind: VerticalPodAutoscaler
242
+
metadata:
243
+
name: example-vpa
244
+
spec:
245
+
targetRef:
246
+
apiVersion: "apps/v1"
247
+
kind: Deployment
248
+
name: example
249
+
updatePolicy:
250
+
# This only disables VPA actuations. It doesn't disable
251
+
# startup boost configurations.
252
+
updateMode: "Off"
253
+
startupBoost:
254
+
cpu:
255
+
value: 3.0
256
+
duration: 10s
257
+
```
258
+
259
+
#### Startup CPU Boost Disabled & VPA Enabled
260
+
261
+
```yaml
262
+
apiVersion: "autoscaling.k8s.io/v1"
263
+
kind: VerticalPodAutoscaler
264
+
metadata:
265
+
name: example-vpa
266
+
spec:
267
+
targetRef:
268
+
apiVersion: "apps/v1"
269
+
kind: Deployment
270
+
name: example
271
+
updatePolicy:
272
+
updateMode: "Auto"
273
+
```
274
+
275
+
#### Startup CPU Boost Enabled & VPA Enabled
250
276
251
277
```yaml
252
278
apiVersion: "autoscaling.k8s.io/v1"
@@ -259,23 +285,77 @@ spec:
259
285
kind: Deployment
260
286
name: example
261
287
updatePolicy:
262
-
# VPA Update mode must be InPlaceOrRecreate
263
-
updateMode: "InPlaceOrRecreate"
288
+
updateMode: "Auto"
289
+
startupBoost:
290
+
cpu:
291
+
value: 3.0
292
+
duration: 10s
293
+
```
294
+
295
+
### Per-container configurations (`startupBoost` configured in `ContainerPolicies`)
296
+
297
+
#### Startup CPU Boost Enabled & VPA Disabled
298
+
299
+
All containers under `example` deployment will receive "regular" VPA updates
300
+
(VPA is in `"Auto"` mode in this example), **except for**
301
+
`boosted-container-name`. `boosted-container-name` will only be CPU
302
+
boosted/unboosted (`StartupBoost` is enabled and VPA `Mode` is set to `Off`).
303
+
304
+
```yaml
305
+
apiVersion: "autoscaling.k8s.io/v1"
306
+
kind: VerticalPodAutoscaler
307
+
metadata:
308
+
name: example-vpa
309
+
spec:
310
+
targetRef:
311
+
apiVersion: "apps/v1"
312
+
kind: Deployment
313
+
name: example
264
314
resourcePolicy:
265
315
containerPolicies:
266
316
- containerName: "boosted-container-name"
267
-
mode: "StartupBoostOnly"
317
+
# VPA mode is set to Off, so it never changes pod resources for this
318
+
# container. This setting is independent from the startup boost mode.
319
+
# CPU startup boost changes will still be applied (mode Auto).
320
+
mode: "Off"
268
321
startupBoost:
322
+
mode: "Auto"
269
323
cpu:
270
324
factor: 2.0
271
325
```
272
326
273
-
### CPU Boost and Vanilla VPA
327
+
#### Startup CPU Boost Disabled & VPA Enabled
328
+
329
+
All containers under `example` deployment will receive "regular" VPA updates
330
+
and be CPU boosted/unboosted, except for `disable-cpu-boost-for-this-container`.
331
+
It has a `containerPolicy` `startupBoost` overriding the global VPA config.
0 commit comments