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

leave a buffer of underutilized nodes when scaling down #5611

Closed
wants to merge 1 commit into from

Conversation

grosser
Copy link
Contributor

@grosser grosser commented Mar 24, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • When scheduling nodes with topologySpreadConstraints ScheduleAnyway the scheduler does not evict capacity buffers and creates skew
  • When trying to de-schedule skewed pods descheduler noops when there is no empty space
    ... so allow users to opt-in to empty space

This is not perfect since it will not create "new empty space" by scaling up, but I think it's a good step forward and allows us to fix some edge-cases that capacity buffer does not solve.

Which issue(s) this PR fixes:

Fixes #5377

Special notes for your reviewer:

Does this PR introduce a user-facing change?

New --scale-down-buffer-ratio flag for ratio of empty or underutilized nodes to leave as capacity buffer per nodegroup

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 24, 2023
@k8s-ci-robot k8s-ci-robot requested a review from x13n March 24, 2023 04:47
@vadasambar
Copy link
Member

Appreciate the PR (though I am not sure I fully understand the problem yet) 👍

When scheduling nodes with topologySpreadConstraints ScheduleAnyway the scheduler does not evict capacity buffers and creates skew

This is expected. CA doesn't support ScheduleAnyway because it is a part of Scoring phase of scheduler. CA only simulates Filter phase (PreFilter and Filter extension points to be precise) and that is so by design.
You might be interested in

@grosser
Copy link
Contributor Author

grosser commented Mar 24, 2023

I know that it's not supported, that's why I made this PR to make it somewhat supported, it's not perfect but might be good enough ... I'll have to test it in our clusters to know more, but wanted to share the approach in case anyone else finds it useful or has inout on how to make it better.

@towca
Copy link
Collaborator

towca commented Mar 24, 2023

/assign @MaciekPytel

@grosser
Copy link
Contributor Author

grosser commented Mar 24, 2023

A better version of this would calculate the "free cpu" on all nodes and then leave "10% of capacity free" instead of this crude node math.

@grosser grosser force-pushed the grosser/scaledownbufferpr branch from 3d49328 to 5be1790 Compare March 24, 2023 19:03
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: grosser
Once this PR has been reviewed and has the lgtm label, please ask for approval from maciekpytel. For more information see the Kubernetes Code Review Process.

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

@grosser
Copy link
Contributor Author

grosser commented Mar 31, 2023

this worked but was not reliable enough (sometimes leaves half a node empty, sometimes full nodes) and cost accounting was not great either (cannot differentiate between bad binpacking and intentional gaps)

@grosser grosser closed this Mar 31, 2023
@grosser grosser deleted the grosser/scaledownbufferpr branch March 31, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support overprovsioning without pending pods
5 participants