Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support AutoscalingTypeOff in AutoscalingPolicy #147

Merged
merged 1 commit into from
Oct 4, 2023
Merged
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
8 changes: 5 additions & 3 deletions api/v1beta1/tortoise_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ type ContainerResourcePolicy struct {
// AutoscalingPolicy specifies how each resource is scaled.
// If "Horizontal", the resource is horizontally scaled.
// If "Vertical", the resource is vertically scaled.
// Now, at least one container in Pod should be Horizontal.
// If "Off", tortoise doesn't scale at all based on that resource.
// At least one container in Pod should be Horizontal.
//
// The default value is "Horizontal" for cpu, and "Vertical" for memory.
// +optional
Expand All @@ -104,10 +105,11 @@ const (
AutoUpdateMode UpdateMode = "Auto"
)

// +kubebuilder:validation:Enum=Horizontal;Vertical
// +kubebuilder:validation:Enum=Off;Horizontal;Vertical
type AutoscalingType string

const (
AutoscalingTypeOff AutoscalingType = "Off"
AutoscalingTypeHorizontal AutoscalingType = "Horizontal"
AutoscalingTypeVertical AutoscalingType = "Vertical"
)
Expand Down Expand Up @@ -290,7 +292,7 @@ type TortoiseCondition struct {
type ContainerRecommendationFromVPA struct {
// ContainerName is the name of target container.
ContainerName string `json:"containerName" protobuf:"bytes,1,name=containerName"`
// MaxRecommendation is the max recommendation value from VPA among certain period (1 week).
// MaxRecommendation is the max recommendation value from VPA in a certain period (1 week).
// Tortoise generates all recommendation based on this MaxRecommendation.
MaxRecommendation map[v1.ResourceName]ResourceQuantity `json:"maxRecommendation" protobuf:"bytes,2,name=maxRecommendation"`
// Recommendation is the latest recommendation value from VPA.
Expand Down
24 changes: 24 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions config/crd/bases/autoscaling.mercari.com_tortoises.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,16 @@ spec:
autoscalingPolicy:
additionalProperties:
enum:
- "Off"
- Horizontal
- Vertical
type: string
description: "AutoscalingPolicy specifies how each resource
is scaled. If \"Horizontal\", the resource is horizontally
scaled. If \"Vertical\", the resource is vertically scaled.
Now, at least one container in Pod should be Horizontal. \n
The default value is \"Horizontal\" for cpu, and \"Vertical\"
If \"Off\", tortoise doesn't scale at all based on that resource.
At least one container in Pod should be Horizontal. \n The
default value is \"Horizontal\" for cpu, and \"Vertical\"
for memory."
type: object
containerName:
Expand Down Expand Up @@ -522,7 +524,7 @@ spec:
type: string
type: object
description: MaxRecommendation is the max recommendation
value from VPA among certain period (1 week). Tortoise
value from VPA in a certain period (1 week). Tortoise
generates all recommendation based on this MaxRecommendation.
type: object
recommendation:
Expand Down
Loading