Provide support for explicitly pausing autoscaling of ScaledObjects at the current replica count #3304
Description
Proposal
Similarly to #3303, it would be nice to provide support for explicitly pausing autoscaling of ScaledObjects at the current replica count so that it no longer scales out/in.
This should be done by applying the autoscaling.keda.sh/is-paused: true
annotation on the ScaledObjects resource. When this is the case, the ScaledObject just sticks with the current amount of replicas when it was applied.
Use-Case
Pause autoscaling without having to check how many replicas we run today.
Anything else?
This is in addition to our existing autoscaling.keda.sh/paused-replicas: <replica-amount>
which allows you to specify a replica count.
When both annotations are applied, the following logic should be used:
- If
autoscaling.keda.sh/paused-replicas
is specified, stop autoscaling and puts to given amount - Otherwise, if
autoscaling.keda.sh/is-paused
is there, just stop autoscaling and keep it at the current instance count - Otherwise, keep scaling 🚀🚀🚀
As a workaround, people can use autoscaling.keda.sh/paused-replicas
as following:
replicas=$(kubectl get deploy <deployment> -n <NS> -o=jsonpath='{.status.replicas}') | kubectl annotate scaledObject -n <NS> <scaledObject name> "autoscaling.keda.sh/paused-replicas=$replicas"
Follow-up for #944
Metadata
Assignees
Type
Projects
Status
Ready To Ship