-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Introduce API changes and feature 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
Introduce API changes and feature gate CPU startup boost #8417
Conversation
|
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
omerap12
left a comment
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
|
|
||
| // 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.
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.
You should make the unionDiscriminator required field, to avoid any defaulting logic and unexpected outcomes. So change +optional to Required and make this not pointer.
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.
Another important question, are you planning other boost types? The reason I'm asking is on one had you're creating a targetted type CPUStartupBoost but inside it you're using generic StartupBoostType. The CPUStartupBoost as I'm reading doesn't have any cpu-specific elements. Hence my question, if you only plan to support CPU, I'd use CPUStartupBoostType. If you're planning to expand StartupBoost in the future with memory, will MemoryStartupBoostType look similar or differently from the current CPUStartupBoost? In general several nested structures (like here) don't play well. For example compare Device in resource/v1beta1 vs Device in resource/v1, in the latter case we squashed the BasicDevice to simplify the nesting. That's why I'm asking for future plans, before going with too many levels in the API.
|
|
||
| // 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
| // 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.
25eab9b to
3159fb2
Compare
vertical-pod-autoscaler/pkg/admission-controller/resource/vpa/handler_test.go
Outdated
Show resolved
Hide resolved
3745ce3 to
5cc0654
Compare
|
The tests are still failing with: |
5cc0654 to
705362e
Compare
705362e to
0000a7a
Compare
|
Thanks @adrianmoisey!! I thought those are unrelated formatting errors. |
omerap12
left a comment
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!
Seems ok to me.
/lgtm
|
/retitle Introduce API changes and feature gate CPU startup boost |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianmoisey, kamarabbas99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/release-note-none |
220c4a3
into
kubernetes:experimental-cpu-boost
|
Hello guys, when is this change scheduled to be released? Thanks! |
|
Hey, |
Thank you for your response. I came across this draft PR #8413 and wanted to check if it's still relevant. I noticed there are some changes concerning the updater that haven't been implemented in that PR. |
I think this feature will be available soon, we have a dedicated branch for this work (which will be merged to master after the work is done ). there is currently a live PR for e2e test here: #8672 |
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.: