-
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 <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
I tested, and I add test case and improve logging for clarifying on the multiple scalers scenario. |
Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
…lation Signed-off-by: Tsuyoshi Ushio <[email protected]>
141bd85
to
784bc7c
Compare
Hi @zroubalik |
MultipleScalersCalculation
e5b9da9
to
cddf760
Compare
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
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 <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]>
Signed-off-by: Tsuyoshi Ushio <[email protected]>
41b2c15
to
6b7e6da
Compare
Signed-off-by: Tsuyoshi Ushio <[email protected]>
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 <[email protected]> * fix pre-commit issue Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update logs on scale handler and add crds Signed-off-by: Tsuyoshi Ushio <[email protected]> * update change log Signed-off-by: Tsuyoshi Ushio <[email protected]> * Add test case for exceeding MaxReplicaCount in sum Signed-off-by: Tsuyoshi Ushio <[email protected]> * fix pre-commit Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update pkg/scaling/scale_handler.go Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update pkg/scaling/scale_handler.go Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * revert version and refactor scaling logic Signed-off-by: Tsuyoshi Ushio <[email protected]> * Change option name from MultipleScalersOption to MultipleScalersCalculation Signed-off-by: Tsuyoshi Ushio <[email protected]> * update changelog for multiple triggers section Signed-off-by: Tsuyoshi Ushio <[email protected]> * Error Handling Signed-off-by: Tsuyoshi Ushio <[email protected]> * Refactor logging Signed-off-by: Tsuyoshi Ushio <[email protected]> * remove scaledjob prometheus Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update pkg/scaling/scaledjob/scale_metrics_test.go Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update pkg/scaling/scaledjob/scale_metrics.go Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * Update CHANGELOG.md Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Tsuyoshi Ushio <[email protected]> * Move section to new section Signed-off-by: Tsuyoshi Ushio <[email protected]> * fix pre-commit white space issue Signed-off-by: Tsuyoshi Ushio <[email protected]> Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: nilayasiktoprak <[email protected]>
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