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

Dynamic maxReplicaCount support (based on a scaler) #1500

Closed
Alexander-Bartosh opened this issue Jan 12, 2021 · 10 comments
Closed

Dynamic maxReplicaCount support (based on a scaler) #1500

Alexander-Bartosh opened this issue Jan 12, 2021 · 10 comments
Labels
feature-request All issues for new features that have not been committed to needs-discussion stale All issues that are marked as stale due to inactivity

Comments

@Alexander-Bartosh
Copy link

A clear and concise description of what you want to happen.
I would like to be able to change maxReplicaCount based on any scaler

One possible implementation might be :
Change maxReplicaCount of a ScaledObject using a different ScaledObject.

Use-Case

To maximize utility change maxReplicaCount of a Build agent scaler on cluster scaling.
Do not trigger cluster scaling, but react on it.

In other words - remove the need to hardcode a number for maxReplicaCount and control resources based on cluster scaling limits

If it is already possible to achieve this could you please share how :)
Thank you!

@Alexander-Bartosh Alexander-Bartosh added feature-request All issues for new features that have not been committed to needs-discussion labels Jan 12, 2021
@Alexander-Bartosh Alexander-Bartosh changed the title Dynamic maxReplicaCount support Dynamic maxReplicaCount support (based on a scaler) Jan 12, 2021
@tomkerkhove
Copy link
Member

This is not possible but I'm interested in the scenario because if the cluster no longer has the resources, we'll scale them out but they will be in a pending state so not sure if there is an issue or what we are trying to fix here.

@Alexander-Bartosh
Copy link
Author

Pending pod will trigger cluster scale up.
Thus you can not scale you workload to optimally fill in existing resources

@Alexander-Bartosh
Copy link
Author

Alexander-Bartosh commented Jan 12, 2021

The maintenance case is also a valid use-case.
You might want all your "optional" workloads to scale to 0(maxReplicaCount) when cluster gets into maintenance mode despite all metrics they usually scale on

@tomkerkhove
Copy link
Member

I think I'm not fully getting your proposal. You suggesting to remove the max instance count, but how would we scale then? 🤔

@Alexander-Bartosh
Copy link
Author

Alexander-Bartosh commented Jan 18, 2021

My apologies for a short description.
I do understand that the intention is not very clear from it.
Let me give an example:

The suggestion is not to remove it, but to make it dynamic, based on a scaler.
That will allow one to optimize resource usage for non-critical workloads.

Lets say you have a backlog of thing to do - MyWorkload
Running one instance will take away one CPU for some time.
Your cluster is dynamic thought-out the day.
Your workload should not be a decisive factor on the current cluster size
You can tolerate total of 30% CPU utilization of the cluster
When the total CPU unitization is more than that - 0 of instances of MyWorkload should be running.
Until it is bellow and your workload is running at maxReplicaCount you can increase maxReplicaCount of MyWorkload
The current number of MyWorkload might be determined by a message Q

CPU metric above is an example.
You can think in the same way regarding any metric (scaler )

@Alexander-Bartosh
Copy link
Author

Alexander-Bartosh commented Jan 18, 2021

To summarize:
Your workload is running at its maxReplicaCount.
And based on a scaler(different scaler) you ask yourself - can I ran 1 more or should I run 1 less ?

@zroubalik
Copy link
Member

This sound more like an custom external scaler? In the scaler you can implement your own scaling logic and scale the target workload based on that.

@Alexander-Bartosh
Copy link
Author

Alexander-Bartosh commented Jan 19, 2021

The main strength of KEDA is variety of simple scalers.
IMO scalers should remain as simple as possible.
And the strength can be multiplied by combining them (1 scaler for currentReplicaCount count and another for maxReplicaCount )

@stale
Copy link

stale bot commented Oct 14, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Oct 14, 2021
@stale
Copy link

stale bot commented Oct 21, 2021

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion stale All issues that are marked as stale due to inactivity
Projects
None yet
Development

No branches or pull requests

3 participants