-
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-autoscaler CAPI scale up when current number of nodes is less than minSize #5267
Comments
@elmiko, can I please ask you to take a look, as one of the CAPI cluster-autoscaler maintainers |
@MaxFedotov apologies for the delay, i am traveling at kubecon this week. i have a couple thoughts about this:
in this specific case though, i think you could make the replicas this is definitely an issue we need to solve with respect to the way ClusterClass works. |
@elmiko Thanks a lot for the explanations!
The thing is that in this case I won't be able in future to use autoscaler with this nodegroup :( My initial intention was to offload all nodegroup size management to cluster-autoscaler, but seems like it is impossible for now, because I need to perform the initial nodegroup scale-up, so it reaches a specific start size. |
yeah, true =(
it sounds like it won't work for you case currently, imo we need solve the issue in the cluster-api community around how this works with ClusterClasses. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
i think there is some interesting discussion happening related to this in kubernetes-sigs/cluster-api#7293 (comment) /remove-lifecycle stale |
Hi @elmiko! Want to go back to this issue after kubernetes-sigs/cluster-api#7990 was merged.
and defaulting webhook will set But if I will update this field, for example, set So for now, if I want to increase a min (or in this case it will be current) number of nodes in an already created nodegroup, I had to update Is there any way (or maybe some plans) to allow users to control min number of nodes in a nodegroup with only cluster-autoscaler annotations? Thanks! |
yeah, i can see how this would be frustrating and possibly brittle. imo, it seems like we might want to propose logic on the cluster-api controllers that could automatically update the replicas if it sees the minimum annotation increased. i'm not sure how the community would feel about that approach, but it's the first thing that came to mind. i have a feeling that reaching across the api boundaries between autoscaler and cluster-api might be confusing if we couple too tightly.
i haven't heard anything like that, but sounds like an interesting idea. |
The interesting thing is that this check
completely prevents an ability to use cluster-autoscaler annotations when using managed Cluster topologies and Maybe it is possible to modify this check and exclude |
that seems like one way we could fix this, i had also suggested the possibility of using some sort of "managed-by" annotation to let the cluster-api parts know when the replicas will be controlled by some other controller. i'm not sure which is the best path forward, but i think we will need to bring this up with the cluster-api community. also, it might be worth making an issue on the cluster-api repo about that issue you've found. that way we can get more attention in the cluster-api community and hopefully get a discussion going there. wdyt? |
Yep, that would be the best place, thank you! Created kubernetes-sigs/cluster-api#8217 :) |
@MaxFedotov given that this is a known behavior of the cluster-autoscaler (see My cluster is below minimum / above maximum number of nodes, but CA did not fix that! Why? ), what do you think about closing this issue in favor of kubernetes-sigs/cluster-api#8217 ? |
do we still need this issue given that we have a flag to control this behavior now? see #5195 i think we should close this, but will wait for a response from @MaxFedotov |
Interesting. Didn't know this flag existed. Also sounds reasonable to me to close this issue (Also: This was merged a year ago? :D) |
Wow, I missed this flag too :) Will give it a try in our staging env and close the issue |
Which component are you using?: Cluster Autoscaler with Cluster API
What version of the component are you using?:
Component version: v1.25.0
What k8s version are you using (
kubectl version
)?: 1.23.7kubectl version
OutputWhat environment is this in?: clusterapi controlled cluster
What did you expect to happen?:
We are using cluster-autoscaler with Cluster API ClusterClass and Managed Topologies feature. According to documentation, the user needs to omit
replicas
field inspec.topology.workers.machineDeployments[]
in order to avoid conflict between cluster-autoscaler and topology controller. Whenreplicas
field is empty by default a single node is provisioned for each MachineDeployment.Our intention was to use cluster-autoscaler to set a default minimum number of replicas for MachineDeployments, so we added
annotations and were expecting to see 2 additional nodes to be provisioned.
What happened instead?:
According to this code
autoscaler/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_nodegroup.go
Lines 358 to 361 in e6ff526
cluster-autoscaler for CAPI skips MachineDeployment where maxSize = minSize, even if the current number of replicas is less the specified minSize.
It seems a bit counterintuitive because the current size of the MachineDeployment is less than minSize specified by user, so there is definitely a capacity to scale till minSize is reached.
The text was updated successfully, but these errors were encountered: