Skip to content

Commit 7040e26

Browse files
jkyrosmaxcao13
authored andcommitted
VPA: Add UpdateModeInPlaceOrRecreate to types
This adds the UpdateModeInPlaceOrRecreate mode to the types so we can use it. Signed-off-by: Max Cao <[email protected]>
1 parent de4a5b7 commit 7040e26

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
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/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)