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

Refactor scale-up to apply resource limits before creating a node group #6769

Conversation

aleksandra-malinowska
Copy link
Contributor

@aleksandra-malinowska aleksandra-malinowska commented Apr 25, 2024

Small refactor prior to the implementation of atomic scale-up support for Provisioning Requests: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/provisioning-request.md

What this PR does / why we need it:

Apply resource limits to scale-up plan before creating a new node group. Note that this is independent of the steps that happen immediately before and after - newNodes aren't used until we balance similar node groups, and non-existent node groups already have to expose node resources (otherwise scale-up simulations wouldn't be possible).

There's already a check in place for skipping a node group if adding even one node would exceed resource limits, so it's not technically a bug right now, and so this PR doesn't change current behavior. However, for the atomic scale up support for Provisioning Requests, we'll want to apply resource limits before taking any action, including creating a new node group.

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 25, 2024
@aleksandra-malinowska
Copy link
Contributor Author

/cc @yaroslava-serdiuk @towca

@yaroslava-serdiuk
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 25, 2024
@towca
Copy link
Collaborator

towca commented May 7, 2024

/lgtm
/approve
/hold

nit: I'd consider adding a test for this behavior (limits exceeded -> ScaleUp error without attempting to create a node group). Feel free to unhold if you don't think it's important

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 7, 2024
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 9, 2024
@aleksandra-malinowska
Copy link
Contributor Author

nit: I'd consider adding a test for this behavior (limits exceeded -> ScaleUp error without attempting to create a node group). Feel free to unhold if you don't think it's important

Added test. Note: while OnGroupCreate isn't used in this test case, I needed to add it to confirm the test indeed works (would trigger autoprovisioning if max cores limit was increased) and decided to left it as I'd have to add it another PR soon anyway.

@towca
Copy link
Collaborator

towca commented May 9, 2024

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 9, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aleksandra-malinowska, towca

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

@aleksandra-malinowska
Copy link
Contributor Author

@towca added the requested unit test, lost lgtm, can you PTAL? Thanks!

@towca
Copy link
Collaborator

towca commented May 10, 2024

It's the hold!
/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 10, 2024
@k8s-ci-robot k8s-ci-robot merged commit 79a2311 into kubernetes:master May 10, 2024
6 checks passed
@yaroslava-serdiuk
Copy link
Contributor

#6815

@yaroslava-serdiuk
Copy link
Contributor

/cherry-pick cluster-autoscaler-release-1.30

@k8s-infra-cherrypick-robot

@yaroslava-serdiuk: new pull request created: #6931

In response to this:

/cherry-pick cluster-autoscaler-release-1.30

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.

@yaroslava-serdiuk
Copy link
Contributor

/assign @towca

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/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants