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

Added ScaledObject parameter StartReplicaCount to scale from 0 to N #5493

Closed
wants to merge 2 commits into from

Conversation

ldimarzi
Copy link

@ldimarzi ldimarzi commented Feb 7, 2024

This pull request introduces a new parameter, startReplicaCount, to the ScaledObject in order to change the scaling behavior from 0. The goal is to facilitate scaling from 0 to N replicas, instead of the default 0 to 1.
This change can be useful in scenarios where applications need fast responsiveness when is activated.

Checklist

Relates to #

PR Helm chart: kedacore/charts#606
PR Documentation: kedacore/keda-docs#1308

@ldimarzi ldimarzi requested a review from a team as a code owner February 7, 2024 15:32
Signed-off-by: Leonardo Di Marzio <[email protected]>
@JorTurFer
Copy link
Member

Hello!
Thanks for the contribution, but this is already supported: https://keda.sh/docs/2.13/concepts/scaling-deployments/#idlereplicacount

You can set idleReplicaCount: 0 and then, KEDA will scale from 0 to minReplicaCount and from minReplicaCount to 0.

@JorTurFer JorTurFer closed this Feb 7, 2024
@ldimarzi
Copy link
Author

ldimarzi commented Feb 8, 2024

Hello @JorTurFer ,

Appreciate your response. With startReplicaCount set to 5, this feature allows scaling from 0 to startReplicaCount. Subsequently, the scaling behavior from startReplicaCount to 0 is gradual, proceeding in example through the sequence 5 -> 4 -> 3 -> 2 -> 1.

Contrary to this, using idleReplicaCount permits scaling only from minReplicaCount to 0.

I'd appreciate your thoughts on these changes considering this description.

@JorTurFer
Copy link
Member

JorTurFer commented Feb 8, 2024

I think that the best way to manage new features is opening an issue to discuss about it.
I see the benefits of this, but I'd like to know the thoughts from other folks.
@zroubalik @tomkerkhove

Given that and talking just about the code, it looks good but the changelog has to follow the style guide and test coverage is required (unit test, e2e test or both)

@zroubalik
Copy link
Member

Yes, please start with an issue first, honestly I don't understand the feature. Imho this behavior is solved by setting for example by settingidleReplicaCount: 0 and minReplicaCount: 5. What am I missing here?

@ldimarzi
Copy link
Author

Hello @zroubalik,

Thank you for your reply. When the startReplicaCount is configured as 5, it enables scaling between 0 and the specified startReplicaCount value. Then the scaling process from startReplicaCount to 0 can be decremental and gradual, in example following sequence such as 5 -> 4 -> 3 -> 2 -> 1 replicas.

In contrast, utilizing idleReplicaCount restricts scaling to occur solely between minReplicaCount:5 and idleReplicaCount:0 without decrementing gradually replicas.

I'd appreciate your thoughts

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.

3 participants