-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Apply CPU startup boost in admission controller if its set #8458
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?
Apply CPU startup boost in admission controller if its set #8458
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. |
/cc laoj2 |
/ok-to-test |
@adrianmoisey yes I plan to rebase this once that PR is merged! |
aa176bc
to
98da2cc
Compare
98da2cc
to
ae29331
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.
Would it be possible to write some simple unit tests for these new functions?
} | ||
|
||
// NewResourceUpdatesCalculator returns a calculator for | ||
// resource update patches. | ||
func NewResourceUpdatesCalculator(recommendationProvider recommendation.Provider) Calculator { | ||
func NewResourceUpdatesCalculator(recommendationProvider recommendation.Provider, maxAllowedCpu string) Calculator { | ||
var maxAllowedCpuQuantity resource.Quantity |
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.
nit:
var maxAllowedCpuQuantity resource.Quantity | |
var maxAllowedCPUQuantity resource.Quantity |
(just because the recommender uses maxAllowedCPU
, with the upper-case CPU
if features.Enabled(features.CPUStartupBoost) { | ||
policy := vpa_api_util.GetContainerResourcePolicy(pod.Spec.Containers[i].Name, vpa.Spec.ResourcePolicy) | ||
if policy != nil && policy.Mode != nil && *policy.Mode == vpa_types.ContainerScalingModeOff { | ||
klog.V(4).Infof("Not applying startup boost for container %s since its scaling mode is Off", pod.Spec.Containers[i].Name) |
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.
Could you switch this to structured logging?
I haven't gone over this in detail yet, just left some nits |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Introduces changes in the admission-controller component to apply cpu startup boost if its set in the vpa spec.
Also the original cpu request is added in annotation so it can be applied back again in updater if the duration has passed.
Special notes for your reviewer:
Depends on #8417
Will rebase once that is merged.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: