-
Notifications
You must be signed in to change notification settings - Fork 4k
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
cluster-api-autoscaler and enforce-node-group-min-size flag #6549
Comments
@MaxFedotov and i talked on k8s slack, we think the solution might be to upgrade the current check for creating a node group to ensure that the limits are valid. code // Ensure the node group would have the capacity to scale
if scalableResource.MaxSize()-scalableResource.MinSize() < 1 {
return nil, nil
} that check occurs in // Ensure the node group has valid scale limits
// allow MinSize = 0
// allow MaxSize = MinSize
// don't allow MaxSize < MinSize
if scalableResource.MaxSize() - scalableResource.MinSize() < 0 {
// log the node group being skipped
return nil, nil
} |
I'm ready to implement a PR with the fix. What do we need to get the triage accepted mark? :) |
@MaxFedotov i was talking with some other people about this and they were giving me some pushback around whether we should support when we were talking about this as an api, it is possible that the user could remove the min/max annotations and then set the node group to the size they want. my colleague posited that if the intention is to stop scaling on the group for some amount of time, then the proper action is to remove the annotation completely. i'm curious what you think and in specific about your use case? |
@elmiko, thanks for your answer!
From my point of view, it is much better to have a single system controlling nodegroup scaling and sizing (cluster-autoscaler), than doing it in two different places. It is especially important if you have some custom tooling built on top of Also, in this case,
From my lazy-user perspective, that will require me to do 3 different actions (remove annotations; scale-up; add annotations back if I will need to have scaling in future) instead of simple annotation update :) |
thanks @MaxFedotov , i think we definitely need to do /something/ given the way that if you would indulge me a little longer, i would like to do some similar research that you have regarding looking at the other providers. my gut is telling me that the proper thing for us to do is to allow |
Thanks @elmiko :) will be waiting for results |
hey @MaxFedotov , still looking at this, also still think we should probably go with your suggestion. |
@elmiko got it, thanks! Let me know your final decision and if we will proceed I will prepare a PR. |
hey @MaxFedotov , been studying the code more. i've put an item on the agenda for monday's sig call just to gather opinions from others. i still haven't found anything that makes we think we shouldn't do this, but you know due diligence and all lol. |
Thanks @elmiko! Hope everything goes well and this change will be supported by everybody. |
talked about this with @gjtempleton at the sig meeting today, curious to see if this works as expected on aws (with the min size flag). @MaxFedotov i think it makes sense to prepare the patch for this, i think we want to capture the logic where "minSize = maxSize when maxSize > 0", we should process that node group. |
@elmiko Great! The only question I have - why not use the previous proposal? I think it will cover all cases, or am I missing something?
|
i think that if
edit: oops, messed up the logic on the first try XD |
Thanks, created a PR :) |
Which component are you using?: cluster-autoscaler
What version of the component are you using?:
Component version: 1.27.4
What did you expect to happen?:
As was discussed in #5267 (comment) user can specify an
enforce-node-group-min-size
for cluster autoscaler to enforce min nodes for the nodegroup.But this solution won't work for clusterapi, if user specify minNodes = maxNodes, because of this check:
autoscaler/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_nodegroup.go
Lines 357 to 360 in a3c8978
so if, for example, user adds the following annotations to his machineDeployment:
min size won't be enforced
@elmiko, pinging you in this issue because seems to be related to our previous discussion.
The text was updated successfully, but these errors were encountered: