-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Introduce API changes and fetaure gate CPU startup boost #8417
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
base: experimental-cpu-boost
Are you sure you want to change the base?
Introduce API changes and fetaure gate CPU startup boost #8417
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kamarabbas99 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @kamarabbas99. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
/cc omerap12 laoj2 |
5bd5b24
to
6415e36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also missing validation: https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/enhancements/7862-cpu-startup-boost#validation
This PR introduces API changes - so we need to adjust all API related stuff including validation.
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
@@ -27,6 +27,9 @@ import ( | |||
|
|||
// Entries are alphabetized. | |||
var defaultVersionedFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{ | |||
CPUStartupBoost: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does CPUStartupBoost
correct? I will never understand this stuff .. lol
@adrianmoisey, you are the expert on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, in this place it's correct (from what I understand)
6415e36
to
4f0b0b3
Compare
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
// Defaults to "Factor". | ||
// +unionDiscriminator | ||
// +required | ||
Type *StartupBoostType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required field shouldn't have omitempty: https://github.com/kubernetes-sigs/kube-api-linter/blob/main/docs/linters.md#requiredfields
Type *StartupBoostType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"` | |
Type *StartupBoostType `json:"type" protobuf:"bytes,1,opt,name=type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made it optional with a default value.
@@ -27,6 +27,9 @@ import ( | |||
|
|||
// Entries are alphabetized. | |||
var defaultVersionedFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{ | |||
CPUStartupBoost: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, in this place it's correct (from what I understand)
if boostType == nil { | ||
// Default to Factor when type is not specified. | ||
defaultType := vpa_types.FactorStartupBoostType | ||
boostType = &defaultType | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that in the API type is marked as required, I'm wondering if that is incorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the API field optional with default value of Factor.
vertical-pod-autoscaler/pkg/admission-controller/resource/vpa/handler.go
Outdated
Show resolved
Hide resolved
@@ -27,6 +27,9 @@ import ( | |||
|
|||
// Entries are alphabetized. | |||
var defaultVersionedFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{ | |||
CPUStartupBoost: { | |||
{Version: version.MustParse("1.5"), Default: false, PreRelease: featuregate.Alpha}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adrianmoisey with InPlaceOrRecreate graduating to Beta in 1.5 (https://github.com/kubernetes/autoscaler/pull/8423/files), does it make sense to make CPU boost available in 1.6+? So it doesn't block the graduation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand, are you suggestion that CPUStartupBoost be available in 1.6 as alpha (default off) or as something else?
Why can't CPUStartupBoost be available as alpha (default off) in 1.5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be available as alpha in 1.5. I'm suggesting that we could release CPU boost in another version (e.g 1.6), because CPU boost is not code complete/(stable too?) yet and we may want to cut a new VPA 1.5.0 release soon (to introduce InPlaceOrRecreate beta) without being blocked by this feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
Well, if this feature is ready by the time we cut 1.5.0 (which may be soon after Kubernetes 1.34, I assume?), then it can go into 1.5.0.
If the feature is not code complete, and PRs not merged into 1.5.0, that's fine too, we just wait until 1.6.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Adrian.
4f0b0b3
to
25eab9b
Compare
25eab9b
to
3159fb2
Compare
vertical-pod-autoscaler/pkg/admission-controller/resource/vpa/handler_test.go
Outdated
Show resolved
Hide resolved
3159fb2
to
ded6238
Compare
So far so good. The flag docs just need updating, then it think it's good to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kamarabbas99!
vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1/types.go
Outdated
Show resolved
Hide resolved
return fmt.Errorf("invalid StartupBoost.CPU.Quantity: %v", err) | ||
} | ||
} | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about checking if both Factor and Quantity are set at the same time? (So we ensure only one of them is set at a time)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I missed that! Thanks @omerap12
ded6238
to
609f127
Compare
609f127
to
89d5553
Compare
89d5553
to
908d6e0
Compare
Oh, and there's a script to update the API docs too: https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/hack/generate-api-docs.sh |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
API Extension: Adds a startupBoost field to the VerticalPodAutoscalerSpec and ContainerResourcePolicy to allow users to define a boost factor or quantity and a
duration.
Which issue(s) this PR fixes:
Fixes #7862
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: