-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ScaledJob: introduce MultipleScalersCalculation
#2016
Conversation
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
I tested, and I add test case and improve logging for clarifying on the multiple scalers scenario. |
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
…lation Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
141bd85
to
784bc7c
Compare
Hi @zroubalik |
MultipleScalersCalculation
e5b9da9
to
cddf760
Compare
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
cddf760
to
96116f8
Compare
Hi @zroubalik |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I have a few very minor nits. Thanks @TsuyoshiUshio !
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
41b2c15
to
6b7e6da
Compare
Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com>
Hi @zroubalik I accept all your suggestion, however, CI / Validate PR looks start to fail. I looked the code change again, however, I just changed ScaledJob related part. The CI fails with the ScaledObjectController. Do you know this issue?
|
That is just a flaky test :( I rerun the job and it fine now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, great job @TsuyoshiUshio !
* Fix bug of ScaledJob multiple triggers Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * fix pre-commit issue Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update logs on scale handler and add crds Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * update change log Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Add test case for exceeding MaxReplicaCount in sum Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * fix pre-commit Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update pkg/scaling/scale_handler.go Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update pkg/scaling/scale_handler.go Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * revert version and refactor scaling logic Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Change option name from MultipleScalersOption to MultipleScalersCalculation Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * update changelog for multiple triggers section Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Error Handling Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Refactor logging Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * remove scaledjob prometheus Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update pkg/scaling/scaledjob/scale_metrics_test.go Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Update CHANGELOG.md Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * Move section to new section Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> * fix pre-commit white space issue Signed-off-by: Tsuyoshi Ushio <ushio@simplearchitect.com> Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com> Signed-off-by: nilayasiktoprak <nilayasiktoprak@gmail.com>
is there a reason why we use For example consider 2 scalers:
Right now |
@TsuyoshiUshio @zroubalik thanks! |
This PR fix issue of multi scalers on Scaled Job. And introduce a new option.
The current login assume only one scaler is active and available.
The most of the cases, it is ok for that. That is why we don't get any issues about it.
However @zroubalik pointed out this issue, I come up with the fix and do some refactoring to make it clear.
I'm not writing documentation yet, before that, I'd like to confirm this logic if fine for you guys.
Once It looks, ok, I'll go ahead full testing and write the documentation and make this PR as not draft.
Spec
Introduce a new option
MultipleScalersCalculation
on ScaledJob.Available Options
The option is how keda calculate
queueLength
andmaxValue
that is the number of pod will be created.max
: default, pick a scaler that has the max number ofqueueLength
.min
: pick a scaler that has the min number ofqueueLength
.avg
: sum up all the active scalers metrics and devided by the number of the active scalers.sum
: sum up all the active scalers metricsChecklist
Fixes #
Document #
kedacore/keda-docs#505