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

Use CurrentReplicas as a minimum for fallback replicas #6464

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rickbrouwer
Copy link
Contributor

@rickbrouwer rickbrouwer commented Jan 5, 2025

When you are running a large number of pods and something goes wrong, Keda uses a fallback (if configured). However, the difference between the fallback.replicas and the current number of replicas can be large.
"Something going wrong" can also be temporary, which means it can suddenly scale down considerably and then return to the correct number of replicas.
With this PR, I want to make sure that you can indicate that it should use the current number of replicas (useCurrentReplicasAsMinimum) as fallback. If the given fallback.replicas is higher than the current replicas, then the fallback.replicas will be used.

  • A new parameter has been added to the fallback struct (useCurrentReplicasAsMinimum)
  • An adjustment has been made in the fallback.go to retrieve the current number of replicas
  • In the scale_scaledobjects.go there was code that determined what the current number of replicas was. This has been moved to the scale_resolvers.go
  • Fallback modified to determine whether to fall back to the fallback.replicas or the current number of replicas

If for any reason this option is not desired, please let me know.

Checklist

Fixes #6450
Docs: kedacore/keda-docs#1519
Relates to discussion: #6334

@rickbrouwer rickbrouwer requested a review from a team as a code owner January 5, 2025 17:50
@rickbrouwer rickbrouwer marked this pull request as draft January 5, 2025 17:50
Signed-off-by: Rick Brouwer <[email protected]>
Signed-off-by: Rick Brouwer <[email protected]>
Signed-off-by: Rick Brouwer <[email protected]>
@rickbrouwer rickbrouwer marked this pull request as ready for review January 6, 2025 09:17
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.

Use CurrentReplicas as a minimum for fallback replicas
1 participant