Use CurrentReplicas as a minimum for fallback replicas #6464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you are running a large number of pods and something goes wrong, Keda uses a
fallback
(if configured). However, the difference between thefallback.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 givenfallback.replicas
is higher than the current replicas, then thefallback.replicas
will be used.useCurrentReplicasAsMinimum
)fallback.go
to retrieve the current number of replicasscale_scaledobjects.go
there was code that determined what the current number of replicas was. This has been moved to thescale_resolvers.go
fallback.replicas
or the current number of replicasIf for any reason this option is not desired, please let me know.
Checklist
Fixes #6450
Docs: kedacore/keda-docs#1519
Relates to discussion: #6334