Skip to content

Commit 835e647

Browse files
authored
Merge pull request #7933 from maxcao13/in-place-updates-apichanges
VPA: Add UpdateModeInPlaceOrRecreate to types
2 parents de4a5b7 + 7b462b1 commit 835e647

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ spec:
458458
- "Off"
459459
- Initial
460460
- Recreate
461+
- InPlaceOrRecreate
461462
- Auto
462463
type: string
463464
type: object

vertical-pod-autoscaler/docs/api.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ _Appears in:_
155155

156156
| Field | Description | Default | Validation |
157157
| --- | --- | --- | --- |
158-
| `updateMode` _[UpdateMode](#updatemode)_ | Controls when autoscaler applies changes to the pod resources.<br />The default is 'Auto'. | | Enum: [Off Initial Recreate Auto] <br /> |
158+
| `updateMode` _[UpdateMode](#updatemode)_ | Controls when autoscaler applies changes to the pod resources.<br />The default is 'Auto'. | | Enum: [Off Initial Recreate InPlaceOrRecreate Auto] <br /> |
159159
| `minReplicas` _integer_ | Minimal number of replicas which need to be alive for Updater to attempt<br />pod eviction (pending other checks like PDB). Only positive values are<br />allowed. Overrides global '--min-replicas' flag. | | |
160160
| `evictionRequirements` _[EvictionRequirement](#evictionrequirement) array_ | EvictionRequirements is a list of EvictionRequirements that need to<br />evaluate to true in order for a Pod to be evicted. If more than one<br />EvictionRequirement is specified, all of them need to be fulfilled to allow eviction. | | |
161161

@@ -208,7 +208,7 @@ _Underlying type:_ _string_
208208
UpdateMode controls when autoscaler applies changes to the pod resources.
209209

210210
_Validation:_
211-
- Enum: [Off Initial Recreate Auto]
211+
- Enum: [Off Initial Recreate InPlaceOrRecreate Auto]
212212

213213
_Appears in:_
214214
- [PodUpdatePolicy](#podupdatepolicy)
@@ -218,7 +218,8 @@ _Appears in:_
218218
| `Off` | UpdateModeOff means that autoscaler never changes Pod resources.<br />The recommender still sets the recommended resources in the<br />VerticalPodAutoscaler object. This can be used for a "dry run".<br /> |
219219
| `Initial` | UpdateModeInitial means that autoscaler only assigns resources on pod<br />creation and does not change them during the lifetime of the pod.<br /> |
220220
| `Recreate` | UpdateModeRecreate means that autoscaler assigns resources on pod<br />creation and additionally can update them during the lifetime of the<br />pod by deleting and recreating the pod.<br /> |
221-
| `Auto` | UpdateModeAuto means that autoscaler assigns resources on pod creation<br />and additionally can update them during the lifetime of the pod,<br />using any available update method. Currently this is equivalent to<br />Recreate, which is the only available update method.<br /> |
221+
| `Auto` | UpdateModeAuto means that autoscaler assigns resources on pod creation<br />and additionally can update them during the lifetime of the pod,<br />using any available update method. Currently this is equivalent to<br />Recreate.<br /> |
222+
| `InPlaceOrRecreate` | UpdateModeInPlaceOrRecreate means that autoscaler tries to assign resources in-place.<br />If this is not possible (e.g., resizing takes too long or is infeasible), it falls back to the<br />"Recreate" update mode.<br />Requires VPA level feature gate "InPlaceOrRecreate" to be enabled<br />on the admission and updater pods.<br />Requires cluster feature gate "InPlacePodVerticalScaling" to be enabled.<br /> |
222223

223224

224225
#### VerticalPodAutoscaler

vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ type PodUpdatePolicy struct {
151151
}
152152

153153
// UpdateMode controls when autoscaler applies changes to the pod resources.
154-
// +kubebuilder:validation:Enum=Off;Initial;Recreate;Auto
154+
// +kubebuilder:validation:Enum=Off;Initial;Recreate;InPlaceOrRecreate;Auto
155155
type UpdateMode string
156156

157157
const (
@@ -169,8 +169,15 @@ const (
169169
// UpdateModeAuto means that autoscaler assigns resources on pod creation
170170
// and additionally can update them during the lifetime of the pod,
171171
// using any available update method. Currently this is equivalent to
172-
// Recreate, which is the only available update method.
172+
// Recreate.
173173
UpdateModeAuto UpdateMode = "Auto"
174+
// UpdateModeInPlaceOrRecreate means that autoscaler tries to assign resources in-place.
175+
// If this is not possible (e.g., resizing takes too long or is infeasible), it falls back to the
176+
// "Recreate" update mode.
177+
// Requires VPA level feature gate "InPlaceOrRecreate" to be enabled
178+
// on the admission and updater pods.
179+
// Requires cluster feature gate "InPlacePodVerticalScaling" to be enabled.
180+
UpdateModeInPlaceOrRecreate UpdateMode = "InPlaceOrRecreate"
174181
)
175182

176183
// PodResourcePolicy controls how autoscaler computes the recommended resources

0 commit comments

Comments
 (0)