Skip to content

Commit 0ccfef9

Browse files
kamarabbas99bpalko
andauthored
feat: CPU startup boost in master (#9141)
* Introduce API changes and fetaure gate CPU startup boost * Apply CPU startup boost in admission controller if its set * Fix VPA startup boost validation error messages Fix VPA startup boost validation error messages * Make changes to updater to add the unboosting logic * Fix test failure after rebase * Add e2e tests for CPU startup boost * Update VPA version for startupboost feature * Address comments on #8813 * Allow unboost even if pod replicas less than "min-replicas" flag * Fix startup boost workflow when limit is not set * Address new comments and Rebase on top of master --------- Co-authored-by: Brendan Palkowski <b.palko@outlook.com>
1 parent 012ad8a commit 0ccfef9

36 files changed

+3054
-55
lines changed

vertical-pod-autoscaler/charts/vertical-pod-autoscaler/crds/vpa-v1-crd-gen.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,114 @@ spec:
396396
when OOM is detected.
397397
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
398398
x-kubernetes-int-or-string: true
399+
startupBoost:
400+
description: |-
401+
startupBoost specifies the startup boost policy for the container.
402+
This overrides any pod-level startup boost policy.
403+
The startup boost policy takes precedence over the rest of the fields in
404+
this struct, except for ContainerName and ControlledValues.
405+
properties:
406+
cpu:
407+
description: |-
408+
cpu specifies the CPU startup boost policy.
409+
If this field is not set, no startup boost is applied.
410+
properties:
411+
durationSeconds:
412+
description: |-
413+
durationSeconds indicates for how long to keep the pod boosted after it goes to Ready.
414+
Defaults to 0.
415+
format: int32
416+
type: integer
417+
factor:
418+
description: |-
419+
factor specifies the factor to apply to the resource request.
420+
This field is required when Type is "Factor".
421+
format: int32
422+
type: integer
423+
quantity:
424+
anyOf:
425+
- type: integer
426+
- type: string
427+
description: |-
428+
quantity specifies the absolute resource quantity to be used as the
429+
resource request and limit during the boost phase.
430+
This field is required when Type is "Quantity".
431+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
432+
x-kubernetes-int-or-string: true
433+
type:
434+
description: |-
435+
type specifies the kind of boost to apply.
436+
Supported values are: "Factor", "Quantity".
437+
No startupboost will be applied for unrecognized values.
438+
enum:
439+
- Factor
440+
- Quantity
441+
type: string
442+
required:
443+
- type
444+
type: object
445+
x-kubernetes-validations:
446+
- message: factor is required when type is Factor and
447+
forbidden otherwise
448+
rule: (self.type == 'Factor') == has(self.factor)
449+
- message: quantity is required when type is Quantity
450+
and forbidden otherwise
451+
rule: (self.type == 'Quantity') == has(self.quantity)
452+
type: object
399453
type: object
400454
type: array
401455
type: object
456+
startupBoost:
457+
description: startupBoost specifies the startup boost policy for the
458+
pod.
459+
properties:
460+
cpu:
461+
description: |-
462+
cpu specifies the CPU startup boost policy.
463+
If this field is not set, no startup boost is applied.
464+
properties:
465+
durationSeconds:
466+
description: |-
467+
durationSeconds indicates for how long to keep the pod boosted after it goes to Ready.
468+
Defaults to 0.
469+
format: int32
470+
type: integer
471+
factor:
472+
description: |-
473+
factor specifies the factor to apply to the resource request.
474+
This field is required when Type is "Factor".
475+
format: int32
476+
type: integer
477+
quantity:
478+
anyOf:
479+
- type: integer
480+
- type: string
481+
description: |-
482+
quantity specifies the absolute resource quantity to be used as the
483+
resource request and limit during the boost phase.
484+
This field is required when Type is "Quantity".
485+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
486+
x-kubernetes-int-or-string: true
487+
type:
488+
description: |-
489+
type specifies the kind of boost to apply.
490+
Supported values are: "Factor", "Quantity".
491+
No startupboost will be applied for unrecognized values.
492+
enum:
493+
- Factor
494+
- Quantity
495+
type: string
496+
required:
497+
- type
498+
type: object
499+
x-kubernetes-validations:
500+
- message: factor is required when type is Factor and forbidden
501+
otherwise
502+
rule: (self.type == 'Factor') == has(self.factor)
503+
- message: quantity is required when type is Quantity and forbidden
504+
otherwise
505+
rule: (self.type == 'Quantity') == has(self.quantity)
506+
type: object
402507
targetRef:
403508
description: |-
404509
TargetRef points to the controller managing the set of pods for the

vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,114 @@ spec:
396396
when OOM is detected.
397397
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
398398
x-kubernetes-int-or-string: true
399+
startupBoost:
400+
description: |-
401+
startupBoost specifies the startup boost policy for the container.
402+
This overrides any pod-level startup boost policy.
403+
The startup boost policy takes precedence over the rest of the fields in
404+
this struct, except for ContainerName and ControlledValues.
405+
properties:
406+
cpu:
407+
description: |-
408+
cpu specifies the CPU startup boost policy.
409+
If this field is not set, no startup boost is applied.
410+
properties:
411+
durationSeconds:
412+
description: |-
413+
durationSeconds indicates for how long to keep the pod boosted after it goes to Ready.
414+
Defaults to 0.
415+
format: int32
416+
type: integer
417+
factor:
418+
description: |-
419+
factor specifies the factor to apply to the resource request.
420+
This field is required when Type is "Factor".
421+
format: int32
422+
type: integer
423+
quantity:
424+
anyOf:
425+
- type: integer
426+
- type: string
427+
description: |-
428+
quantity specifies the absolute resource quantity to be used as the
429+
resource request and limit during the boost phase.
430+
This field is required when Type is "Quantity".
431+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
432+
x-kubernetes-int-or-string: true
433+
type:
434+
description: |-
435+
type specifies the kind of boost to apply.
436+
Supported values are: "Factor", "Quantity".
437+
No startupboost will be applied for unrecognized values.
438+
enum:
439+
- Factor
440+
- Quantity
441+
type: string
442+
required:
443+
- type
444+
type: object
445+
x-kubernetes-validations:
446+
- message: factor is required when type is Factor and
447+
forbidden otherwise
448+
rule: (self.type == 'Factor') == has(self.factor)
449+
- message: quantity is required when type is Quantity
450+
and forbidden otherwise
451+
rule: (self.type == 'Quantity') == has(self.quantity)
452+
type: object
399453
type: object
400454
type: array
401455
type: object
456+
startupBoost:
457+
description: startupBoost specifies the startup boost policy for the
458+
pod.
459+
properties:
460+
cpu:
461+
description: |-
462+
cpu specifies the CPU startup boost policy.
463+
If this field is not set, no startup boost is applied.
464+
properties:
465+
durationSeconds:
466+
description: |-
467+
durationSeconds indicates for how long to keep the pod boosted after it goes to Ready.
468+
Defaults to 0.
469+
format: int32
470+
type: integer
471+
factor:
472+
description: |-
473+
factor specifies the factor to apply to the resource request.
474+
This field is required when Type is "Factor".
475+
format: int32
476+
type: integer
477+
quantity:
478+
anyOf:
479+
- type: integer
480+
- type: string
481+
description: |-
482+
quantity specifies the absolute resource quantity to be used as the
483+
resource request and limit during the boost phase.
484+
This field is required when Type is "Quantity".
485+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
486+
x-kubernetes-int-or-string: true
487+
type:
488+
description: |-
489+
type specifies the kind of boost to apply.
490+
Supported values are: "Factor", "Quantity".
491+
No startupboost will be applied for unrecognized values.
492+
enum:
493+
- Factor
494+
- Quantity
495+
type: string
496+
required:
497+
- type
498+
type: object
499+
x-kubernetes-validations:
500+
- message: factor is required when type is Factor and forbidden
501+
otherwise
502+
rule: (self.type == 'Factor') == has(self.factor)
503+
- message: quantity is required when type is Quantity and forbidden
504+
otherwise
505+
rule: (self.type == 'Quantity') == has(self.quantity)
506+
type: object
402507
targetRef:
403508
description: |-
404509
TargetRef points to the controller managing the set of pods for the

vertical-pod-autoscaler/docs/api.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ _Appears in:_
5050
| `controlledValues` _[ContainerControlledValues](#containercontrolledvalues)_ | Specifies which resource values should be controlled.<br />The default is "RequestsAndLimits". | | Enum: [RequestsAndLimits RequestsOnly] <br />Optional: \{\} <br /> |
5151
| `oomBumpUpRatio` _[Quantity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.35/#quantity-resource-api)_ | oomBumpUpRatio is the ratio to increase memory when OOM is detected. | | Optional: \{\} <br /> |
5252
| `oomMinBumpUp` _[Quantity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.35/#quantity-resource-api)_ | oomMinBumpUp is the minimum increase in memory when OOM is detected. | | Optional: \{\} <br /> |
53+
| `startupBoost` _[StartupBoost](#startupboost)_ | startupBoost specifies the startup boost policy for the container.<br />This overrides any pod-level startup boost policy.<br />The startup boost policy takes precedence over the rest of the fields in<br />this struct, except for ContainerName and ControlledValues. | | Optional: \{\} <br /> |
5354

5455

5556
#### ContainerScalingMode
@@ -107,6 +108,8 @@ _Appears in:_
107108
| `changeRequirement` _[EvictionChangeRequirement](#evictionchangerequirement)_ | | | Enum: [TargetHigherThanRequests TargetLowerThanRequests] <br /> |
108109

109110

111+
112+
110113
#### HistogramCheckpoint
111114

112115

@@ -204,6 +207,41 @@ _Appears in:_
204207
| `containerRecommendations` _[RecommendedContainerResources](#recommendedcontainerresources) array_ | Resources recommended by the autoscaler for each container. | | Optional: \{\} <br /> |
205208

206209

210+
#### StartupBoost
211+
212+
213+
214+
StartupBoost defines the startup boost policy.
215+
216+
217+
218+
_Appears in:_
219+
- [ContainerResourcePolicy](#containerresourcepolicy)
220+
- [VerticalPodAutoscalerSpec](#verticalpodautoscalerspec)
221+
222+
| Field | Description | Default | Validation |
223+
| --- | --- | --- | --- |
224+
| `cpu` _[GenericStartupBoost](#genericstartupboost)_ | cpu specifies the CPU startup boost policy.<br />If this field is not set, no startup boost is applied. | | Optional: \{\} <br /> |
225+
226+
227+
#### StartupBoostType
228+
229+
_Underlying type:_ _string_
230+
231+
StartupBoostType is the type of startup boost.
232+
233+
_Validation:_
234+
- Enum: [Factor Quantity]
235+
236+
_Appears in:_
237+
- [GenericStartupBoost](#genericstartupboost)
238+
239+
| Field | Description |
240+
| --- | --- |
241+
| `Factor` | FactorStartupBoostType applies a factor to the resource.<br /> |
242+
| `Quantity` | QuantityStartupBoostType applies a fixed quantity to the resource.<br /> |
243+
244+
207245
#### UpdateMode
208246

209247
_Underlying type:_ _string_
@@ -380,6 +418,7 @@ _Appears in:_
380418
| `updatePolicy` _[PodUpdatePolicy](#podupdatepolicy)_ | Describes the rules on how changes are applied to the pods.<br />If not specified, all fields in the `PodUpdatePolicy` are set to their<br />default values. | | Optional: \{\} <br /> |
381419
| `resourcePolicy` _[PodResourcePolicy](#podresourcepolicy)_ | Controls how the autoscaler computes recommended resources.<br />The resource policy may be used to set constraints on the recommendations<br />for individual containers.<br />If any individual containers need to be excluded from getting the VPA recommendations, then<br />it must be disabled explicitly by setting mode to "Off" under containerPolicies.<br />If not specified, the autoscaler computes recommended resources for all containers in the pod,<br />without additional constraints. | | Optional: \{\} <br /> |
382420
| `recommenders` _[VerticalPodAutoscalerRecommenderSelector](#verticalpodautoscalerrecommenderselector) array_ | Recommender responsible for generating recommendation for this object.<br />List should be empty (then the default recommender will generate the<br />recommendation) or contain exactly one recommender. | | Optional: \{\} <br /> |
421+
| `startupBoost` _[StartupBoost](#startupboost)_ | startupBoost specifies the startup boost policy for the pod. | | Optional: \{\} <br /> |
383422

384423

385424
#### VerticalPodAutoscalerStatus

0 commit comments

Comments
 (0)