Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,96 @@ spec:
when OOM is detected.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
startupBoost:
description: |-
startupBoost specifies the startup boost policy for the container.
This overrides any pod-level startup boost policy.
The startup boost policy takes precedence over the rest of the fields in
this struct, except for ContainerName and ControlledValues.
properties:
cpu:
description: |-
cpu specifies the CPU startup boost policy.
If this field is not set, no startup boost is applied.
properties:
duration:
description: |-
duration indicates for how long to keep the pod boosted after it goes to Ready.
Defaults to 0s.
type: string
factor:
description: |-
factor specifies the factor to apply to the resource request.
This field is to be used only when Type is "Factor".
format: int32
type: integer
quantity:
anyOf:
- type: integer
- type: string
description: |-
quantity specifies the absolute resource quantity to be used as the
resource request and limit during the boost phase.
This field is to be used only when Type is "Quantity".
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type:
description: |-
type specifies the kind of boost to apply.
Supported values are: "Factor", "Quantity".
enum:
- Factor
- Quantity
type: string
required:
- type
type: object
type: object
type: object
type: array
type: object
startupBoost:
description: startupBoost specifies the startup boost policy for the
pod.
properties:
cpu:
description: |-
cpu specifies the CPU startup boost policy.
If this field is not set, no startup boost is applied.
properties:
duration:
description: |-
duration indicates for how long to keep the pod boosted after it goes to Ready.
Defaults to 0s.
type: string
factor:
description: |-
factor specifies the factor to apply to the resource request.
This field is to be used only when Type is "Factor".
format: int32
type: integer
quantity:
anyOf:
- type: integer
- type: string
description: |-
quantity specifies the absolute resource quantity to be used as the
resource request and limit during the boost phase.
This field is to be used only when Type is "Quantity".
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type:
description: |-
type specifies the kind of boost to apply.
Supported values are: "Factor", "Quantity".
enum:
- Factor
- Quantity
type: string
required:
- type
type: object
type: object
targetRef:
description: |-
TargetRef points to the controller managing the set of pods for the
Expand Down
87 changes: 87 additions & 0 deletions vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,96 @@ spec:
when OOM is detected.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
startupBoost:
description: |-
startupBoost specifies the startup boost policy for the container.
This overrides any pod-level startup boost policy.
The startup boost policy takes precedence over the rest of the fields in
this struct, except for ContainerName and ControlledValues.
properties:
cpu:
description: |-
cpu specifies the CPU startup boost policy.
If this field is not set, no startup boost is applied.
properties:
duration:
description: |-
duration indicates for how long to keep the pod boosted after it goes to Ready.
Defaults to 0s.
type: string
factor:
description: |-
factor specifies the factor to apply to the resource request.
This field is to be used only when Type is "Factor".
format: int32
type: integer
quantity:
anyOf:
- type: integer
- type: string
description: |-
quantity specifies the absolute resource quantity to be used as the
resource request and limit during the boost phase.
This field is to be used only when Type is "Quantity".
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type:
description: |-
type specifies the kind of boost to apply.
Supported values are: "Factor", "Quantity".
enum:
- Factor
- Quantity
type: string
required:
- type
type: object
type: object
type: object
type: array
type: object
startupBoost:
description: startupBoost specifies the startup boost policy for the
pod.
properties:
cpu:
description: |-
cpu specifies the CPU startup boost policy.
If this field is not set, no startup boost is applied.
properties:
duration:
description: |-
duration indicates for how long to keep the pod boosted after it goes to Ready.
Defaults to 0s.
type: string
factor:
description: |-
factor specifies the factor to apply to the resource request.
This field is to be used only when Type is "Factor".
format: int32
type: integer
quantity:
anyOf:
- type: integer
- type: string
description: |-
quantity specifies the absolute resource quantity to be used as the
resource request and limit during the boost phase.
This field is to be used only when Type is "Quantity".
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type:
description: |-
type specifies the kind of boost to apply.
Supported values are: "Factor", "Quantity".
enum:
- Factor
- Quantity
type: string
required:
- type
type: object
type: object
targetRef:
description: |-
TargetRef points to the controller managing the set of pods for the
Expand Down
39 changes: 39 additions & 0 deletions vertical-pod-autoscaler/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ _Appears in:_
| `controlledValues` _[ContainerControlledValues](#containercontrolledvalues)_ | Specifies which resource values should be controlled.<br />The default is "RequestsAndLimits". | | Enum: [RequestsAndLimits RequestsOnly] <br /> |
| `oomBumpUpRatio` _[Quantity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#quantity-resource-api)_ | oomBumpUpRatio is the ratio to increase memory when OOM is detected. | | |
| `oomMinBumpUp` _[Quantity](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#quantity-resource-api)_ | oomMinBumpUp is the minimum increase in memory when OOM is detected. | | |
| `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. | | |


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




#### HistogramCheckpoint


Expand Down Expand Up @@ -203,6 +206,41 @@ _Appears in:_
| `containerRecommendations` _[RecommendedContainerResources](#recommendedcontainerresources) array_ | Resources recommended by the autoscaler for each container. | | |


#### StartupBoost



StartupBoost defines the startup boost policy.



_Appears in:_
- [ContainerResourcePolicy](#containerresourcepolicy)
- [VerticalPodAutoscalerSpec](#verticalpodautoscalerspec)

| Field | Description | Default | Validation |
| --- | --- | --- | --- |
| `cpu` _[GenericStartupBoost](#genericstartupboost)_ | cpu specifies the CPU startup boost policy.<br />If this field is not set, no startup boost is applied. | | |


#### StartupBoostType

_Underlying type:_ _string_

StartupBoostType is the type of startup boost.

_Validation:_
- Enum: [Factor Quantity]

_Appears in:_
- [GenericStartupBoost](#genericstartupboost)

| Field | Description |
| --- | --- |
| `Factor` | FactorStartupBoostType applies a factor to the resource.<br /> |
| `Quantity` | QuantityStartupBoostType applies a fixed quantity to the resource.<br /> |


#### UpdateMode

_Underlying type:_ _string_
Expand Down Expand Up @@ -379,6 +417,7 @@ _Appears in:_
| `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. | | |
| `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. | | |
| `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. | | |
| `startupBoost` _[StartupBoost](#startupboost)_ | startupBoost specifies the startup boost policy for the pod. | | |


#### VerticalPodAutoscalerStatus
Expand Down
64 changes: 62 additions & 2 deletions vertical-pod-autoscaler/docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [CPU Recommendation Rounding](#cpu-recommendation-rounding)
- [Memory Recommendation Rounding](#memory-recommendation-rounding)
- [In-Place Updates](#in-place-updates-inplaceorrecreate)
- [CPU Startup Boost](#cpu-startup-boost)

## Limits control

Expand Down Expand Up @@ -80,7 +81,7 @@ To enable this feature, set the `--round-memory-bytes` flag when running the VPA

## In-Place Updates (`InPlaceOrRecreate`)

> [!WARNING]
> [!WARNING]
> FEATURE STATE: VPA v1.4.0 [alpha]
> FEATURE STATE: VPA v1.5.0 [beta]

Expand Down Expand Up @@ -125,7 +126,7 @@ Enable the feature by setting the following flags in VPA components ( for both u

```bash
--feature-gates=InPlaceOrRecreate=true
```
```

### Limitations

Expand Down Expand Up @@ -153,3 +154,62 @@ VPA provides metrics to track in-place update operations:
* `vpa_vpas_with_in_place_updatable_pods_total`: Number of VPAs with pods eligible for in-place updates
* `vpa_vpas_with_in_place_updated_pods_total`: Number of VPAs with successfully in-place updated pods
* `vpa_updater_failed_in_place_update_attempts_total`: Number of failed attempts to update pods in-place.

## CPU Startup Boost

> [!WARNING]
> FEATURE STATE: VPA v1.6.0 [alpha]

The CPU Startup Boost feature allows VPA to temporarily increase CPU requests and limits for containers during pod startup. This can help workloads that have high CPU demands during their initialization phase, such as Java applications, to start faster. Once the pod is considered `Ready` and an optional duration has passed, VPA scales the CPU resources back down to their normal levels using an in-place resize.

For more details, see [AEP-7862: CPU Startup Boost](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/enhancements/7862-cpu-startup-boost).

### Usage

CPU Startup Boost is configured via the `startupBoost` field in the `VerticalPodAutoscalerSpec` or within the per-container `containerPolicies`. This allows for both global and per-container boost configurations.

This example enables a startup boost for all containers in the targeted deployment. The CPU will be multiplied by a factor of 3 for 10 seconds after the pod becomes ready.

```yaml
apiVersion: "autoscaling.k8s.io/v1"
kind: VerticalPodAutoscaler
metadata:
name: example-vpa
spec:
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: example
updatePolicy:
updateMode: "Recreate"
startupBoost:
cpu:
type: "Factor"
factor: 3
duration: 10s
```

### Behavior

1. When a pod managed by the VPA is created, the VPA Admission Controller applies the CPU boost.
2. The VPA Updater monitors the pod. Once the pod's condition is `Ready` and the `startupBoost.cpu.duration` has elapsed, it scales the CPU resources down in-place.
3. The scale-down/unboost target is either the VPA recommendation (if VPA is enabled for the container) or the original CPU resources defined in the pod spec.

### Requirements

* Kubernetes 1.33+ with the `InPlacePodVerticalScaling` feature gate enabled.
* VPA version 1.6.0+ with the `CPUStartupBoost` feature gate enabled.

### Configuration

Enable the feature by setting the `CPUStartupBoost` feature gate in the VPA admission-controller and updater components:

```bash
--feature-gates=CPUStartupBoost=true
```

The `startupBoost` field contains a `cpu` field with the following sub-fields:
* `type`: (Required) The type of boost. Can be `Factor` to multiply the CPU, or `Quantity` to add a specific CPU value.
* `factor`: (Optional) The multiplier to apply if `type` is `Factor` (e.g., 2 for 2x CPU). Required if `type` is `Factor`.
* `quantity`: (Optional) The amount of CPU to add if `type` is `Quantity` (e.g., "500m"). Required if `type` is `Quantity`.
* `duration`: (Optional) How long to keep the boost active *after* the pod becomes `Ready`. Defaults to `0s`.
Loading