Skip to content

Conversation

@kamarabbas99
Copy link
Contributor

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?

Users can now configure a startupBoost policy in the VPA spec. 

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: (https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler/enhancements/7862-cpu-startup-boost#aep-7862-cpu-startup-boost)

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. area/vertical-pod-autoscaler labels Aug 7, 2025
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-area labels Aug 7, 2025
@adrianmoisey
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 7, 2025
@kamarabbas99
Copy link
Contributor Author

/cc omerap12 laoj2

@k8s-ci-robot k8s-ci-robot requested review from laoj2 and omerap12 August 7, 2025 20:31
@kamarabbas99 kamarabbas99 force-pushed the feature-cpu-boost-api branch 2 times, most recently from 5bd5b24 to 6415e36 Compare August 7, 2025 21:02
Copy link
Member

@omerap12 omerap12 left a 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.


// Entries are alphabetized.
var defaultVersionedFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{
CPUStartupBoost: {
Copy link
Member

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

Copy link
Member

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)

@kamarabbas99 kamarabbas99 force-pushed the feature-cpu-boost-api branch from 6415e36 to 4f0b0b3 Compare August 8, 2025 18:11
// Defaults to "Factor".
// +unionDiscriminator
// +required
Type *StartupBoostType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"`
Copy link
Member

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

Suggested change
Type *StartupBoostType `json:"type,omitempty" protobuf:"bytes,1,opt,name=type"`
Type *StartupBoostType `json:"type" protobuf:"bytes,1,opt,name=type"`

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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: {
Copy link
Member

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)

Comment on lines 201 to 205
if boostType == nil {
// Default to Factor when type is not specified.
defaultType := vpa_types.FactorStartupBoostType
boostType = &defaultType
}
Copy link
Member

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?

Copy link
Contributor Author

@kamarabbas99 kamarabbas99 Aug 11, 2025

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.

// Entries are alphabetized.
var defaultVersionedFeatureGates = map[featuregate.Feature]featuregate.VersionedSpecs{
CPUStartupBoost: {
{Version: version.MustParse("1.5"), Default: false, PreRelease: featuregate.Alpha},
Copy link
Contributor

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?

Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with Adrian.

@kamarabbas99 kamarabbas99 force-pushed the feature-cpu-boost-api branch 2 times, most recently from 25eab9b to 3159fb2 Compare August 11, 2025 13:58
@kamarabbas99
Copy link
Contributor Author

Made some API changes to address concerns by @soltysh.

Now we use GenericStartupBoost which can also be used by memory boost in case we plan to extend. Also Factor is not default based on @soltysh suggestion and I will update KEP on master in a seperate PR.

@adrianmoisey
Copy link
Member

The tests are still failing with:

VPA flags documentation has been generated in /home/runner/work/autoscaler/autoscaler/go/src/k8s.io/autoscaler/vertical-pod-autoscaler/hack/../docs/flags.md
VPA flags are not up to date. Please run /home/runner/work/autoscaler/autoscaler/go/src/k8s.io/autoscaler/vertical-pod-autoscaler/hack/../hack/generate-flags.sh

@kamarabbas99 kamarabbas99 force-pushed the feature-cpu-boost-api branch from 5cc0654 to 705362e Compare August 21, 2025 15:20
@kamarabbas99 kamarabbas99 force-pushed the feature-cpu-boost-api branch from 705362e to 0000a7a Compare August 21, 2025 15:33
@kamarabbas99
Copy link
Contributor Author

Thanks @adrianmoisey!! I thought those are unrelated formatting errors.

Copy link
Member

@omerap12 omerap12 left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 22, 2025
@adrianmoisey
Copy link
Member

/retitle Introduce API changes and feature gate CPU startup boost

@k8s-ci-robot k8s-ci-robot changed the title Introduce API changes and fetaure gate CPU startup boost Introduce API changes and feature gate CPU startup boost Aug 23, 2025
@adrianmoisey
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 23, 2025
@omerap12
Copy link
Member

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 23, 2025
@k8s-ci-robot k8s-ci-robot merged commit 220c4a3 into kubernetes:experimental-cpu-boost Aug 23, 2025
7 checks passed
@alextarasov-spot
Copy link

Hello guys, when is this change scheduled to be released? Thanks!

@adrianmoisey
Copy link
Member

Hey,
There is no timeline. It could be close to when the next version of Kubernetes is released, or the one after that. But no promises on when it will be released.

@alextarasov-spot
Copy link

Hey, There is no timeline. It could be close to when the next version of Kubernetes is released, or the one after that. But no promises on when it will be released.

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.

@omerap12
Copy link
Member

Hey, There is no timeline. It could be close to when the next version of Kubernetes is released, or the one after that. But no promises on when it will be released.

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
So most of the work is already done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants