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

KUBE-5984 - ensure that scale-ups always occur when there are starved pods #225

Merged

Conversation

triorph
Copy link
Contributor

@triorph triorph commented Jun 23, 2023

This fixes #224

The main change here is to add a ScaleOnStarve option to the node group configuration. This true/false value configures an additional check on the nodeDelta calculated during the scaling step.

When we gather the RequestedPod, we also gather the largest pending pods (by both CPU and Memory). When we gather the node capacity, we also gather the largest node (node with allocatable CPU/Memory minus used pod CPU/memory) that is the highest. If either of the requested pods have larger requirements than what's available on the largest capacity, then that indicates we have a "starved pod". In the case that a pod exists with no nodes available (and we have ScaleOnStarve enabled), then we make sure that the scaling algorithm has at least 1 scale up as the final result.

@awprice
Copy link
Member

awprice commented Jun 23, 2023

This solves #224

If you want this to close the issue, you'll need to use the keywords from here - https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword, e.g. closes/fixes/resolves etc.

Copy link
Member

@awprice awprice left a comment

Choose a reason for hiding this comment

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

Overall looks really good, just some small nits and clarifications

pkg/k8s/util.go Outdated Show resolved Hide resolved
pkg/k8s/util.go Outdated Show resolved Hide resolved
pkg/controller/controller.go Show resolved Hide resolved
pkg/k8s/util.go Outdated Show resolved Hide resolved
@awprice
Copy link
Member

awprice commented Jun 23, 2023

Would be good to see in the description of this PR what the change does to fix the issue - I had to look through the code to see how it addresses the original issue

awprice
awprice previously approved these changes Jun 27, 2023
@awprice
Copy link
Member

awprice commented Jun 27, 2023

LGTM - thanks for the contribution!

Jacobious52
Jacobious52 previously approved these changes Jun 30, 2023
Copy link
Member

@Jacobious52 Jacobious52 left a comment

Choose a reason for hiding this comment

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

Looks good. Only that one nit from me, happy to leave decision to you.

pkg/controller/controller.go Outdated Show resolved Hide resolved
@triorph triorph dismissed stale reviews from Jacobious52 and awprice via 9ae4707 July 2, 2023 21:49
@awprice awprice merged commit b82fb50 into atlassian:master Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Large pods may be neglected if pod's requested resources do not trigger scale up
5 participants