diff --git a/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml b/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml index 70345adccc..70adb552bb 100644 --- a/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml +++ b/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml @@ -458,6 +458,7 @@ spec: - "Off" - Initial - Recreate + - InPlaceOrRecreate - Auto type: string type: object diff --git a/vertical-pod-autoscaler/docs/api.md b/vertical-pod-autoscaler/docs/api.md index 53863e326d..f7e03b0611 100644 --- a/vertical-pod-autoscaler/docs/api.md +++ b/vertical-pod-autoscaler/docs/api.md @@ -155,7 +155,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | -| `updateMode` _[UpdateMode](#updatemode)_ | Controls when autoscaler applies changes to the pod resources.
The default is 'Auto'. | | Enum: [Off Initial Recreate Auto]
| +| `updateMode` _[UpdateMode](#updatemode)_ | Controls when autoscaler applies changes to the pod resources.
The default is 'Auto'. | | Enum: [Off Initial Recreate InPlaceOrRecreate Auto]
| | `minReplicas` _integer_ | Minimal number of replicas which need to be alive for Updater to attempt
pod eviction (pending other checks like PDB). Only positive values are
allowed. Overrides global '--min-replicas' flag. | | | | `evictionRequirements` _[EvictionRequirement](#evictionrequirement) array_ | EvictionRequirements is a list of EvictionRequirements that need to
evaluate to true in order for a Pod to be evicted. If more than one
EvictionRequirement is specified, all of them need to be fulfilled to allow eviction. | | | @@ -208,7 +208,7 @@ _Underlying type:_ _string_ UpdateMode controls when autoscaler applies changes to the pod resources. _Validation:_ -- Enum: [Off Initial Recreate Auto] +- Enum: [Off Initial Recreate InPlaceOrRecreate Auto] _Appears in:_ - [PodUpdatePolicy](#podupdatepolicy) @@ -218,7 +218,8 @@ _Appears in:_ | `Off` | UpdateModeOff means that autoscaler never changes Pod resources.
The recommender still sets the recommended resources in the
VerticalPodAutoscaler object. This can be used for a "dry run".
| | `Initial` | UpdateModeInitial means that autoscaler only assigns resources on pod
creation and does not change them during the lifetime of the pod.
| | `Recreate` | UpdateModeRecreate means that autoscaler assigns resources on pod
creation and additionally can update them during the lifetime of the
pod by deleting and recreating the pod.
| -| `Auto` | UpdateModeAuto means that autoscaler assigns resources on pod creation
and additionally can update them during the lifetime of the pod,
using any available update method. Currently this is equivalent to
Recreate, which is the only available update method.
| +| `Auto` | UpdateModeAuto means that autoscaler assigns resources on pod creation
and additionally can update them during the lifetime of the pod,
using any available update method. Currently this is equivalent to
Recreate.
| +| `InPlaceOrRecreate` | UpdateModeInPlaceOrRecreate means that autoscaler tries to assign resources in-place.
If this is not possible (e.g., resizing takes too long or is infeasible), it falls back to the
"Recreate" update mode.
Requires VPA level feature gate "InPlaceOrRecreate" to be enabled
on the admission and updater pods.
Requires cluster feature gate "InPlacePodVerticalScaling" to be enabled.
| #### VerticalPodAutoscaler diff --git a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go index db9d43a686..6ae164ce4c 100644 --- a/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go +++ b/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go @@ -151,7 +151,7 @@ type PodUpdatePolicy struct { } // UpdateMode controls when autoscaler applies changes to the pod resources. -// +kubebuilder:validation:Enum=Off;Initial;Recreate;Auto +// +kubebuilder:validation:Enum=Off;Initial;Recreate;InPlaceOrRecreate;Auto type UpdateMode string const ( @@ -169,8 +169,15 @@ const ( // UpdateModeAuto means that autoscaler assigns resources on pod creation // and additionally can update them during the lifetime of the pod, // using any available update method. Currently this is equivalent to - // Recreate, which is the only available update method. + // Recreate. UpdateModeAuto UpdateMode = "Auto" + // UpdateModeInPlaceOrRecreate means that autoscaler tries to assign resources in-place. + // If this is not possible (e.g., resizing takes too long or is infeasible), it falls back to the + // "Recreate" update mode. + // Requires VPA level feature gate "InPlaceOrRecreate" to be enabled + // on the admission and updater pods. + // Requires cluster feature gate "InPlacePodVerticalScaling" to be enabled. + UpdateModeInPlaceOrRecreate UpdateMode = "InPlaceOrRecreate" ) // PodResourcePolicy controls how autoscaler computes the recommended resources