-
Notifications
You must be signed in to change notification settings - Fork 817
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
Allowing list based fleet autoscaler to scale up from 0 replicas #4016
Allowing list based fleet autoscaler to scale up from 0 replicas #4016
Conversation
Build Failed 😭 Build Id: 25e4d80b-55cc-4532-8766-327c7aef4f6b Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😭 Build Id: 331c643b-c73d-4936-bb87-5c807f6ed5b9 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 🥳 Build Id: 3dace961-2d7e-4b5e-a39c-67940acfadb7 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
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.
Thanks for submitting the PR and tests!
} else { | ||
additionalReplicas = int32(math.Ceil((float64(minCapacity) - float64(aggCapacity)) / float64(capacity))) | ||
} |
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.
I'm not sure we need this here? The case of scaling up to minCapacity should get caught here
limited, scale := isLimited(aggCapacity, minCapacity, maxCapacity) |
func scaleUpLimited(replicas int32, capacity, aggCapacity, minCapacity int64) (int32, bool, error) { |
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.
In this case limited = true, since aggCapacity = 0 is less than minCapacity.
Since the scaleup function only does a limit for MaxCapacity, the desired capacity is set to max value.
In the next run it will be set back to min value!. I saw this in the fleet autoscaler log. Isn't that dangerous?
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.
I mean that the scaleUp
function itself shouldn't be called when aggCapacity = 0. The function called when aggCapacity = 0 is scaleUpLimited
.
Build Succeeded 🥳 Build Id: f259b1da-ce0c-4710-b641-d87f4cc659b4 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 🥳 Build Id: 0148e88a-48e7-42a2-929d-80dbe09607fe The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
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.
LGTM, thanks for all your work on this!
Build Succeeded 🥳 Build Id: aaaab275-0af0-41e1-a3be-4b2d40010c48 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
What type of PR is this?
/kind bug
What this PR does / Why we need it:
Updated the controller to initialize the list status map with empty AggregatedListStatus from fleet spec.
This allows scaling up if replicas is set to 0. Which is usually the case when deployed via Gitops systems ex. Flux.
Additionally updated the
scaleUp
function does limited scale to MinCapacity as well. Added this since I saw the desired capacity being set to Max first and then brought back to min! (This could be dangerous if the max is set to a high value)I see that in most of the places we round up for calculating the number of replicas. This was missing for limited scaling using lists which is causing values to flap a bit for which I added a fix. Some of the tests were failing. Ex. to have a target max capacity of 45 with capacity of 10, the system was calculating 4 instead of 5. Let me know if that change is okay.
Which issue(s) this PR fixes:
Closes #3943
Special notes for your reviewer: