-
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
Add support for the "Value" metric type in all scalers #2309
Conversation
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
6786b78
to
5e51a85
Compare
/run-e2e |
/run-e2e mongodb.test* |
/run-e2e azure-queue-trigger-auth* Update: You can check the progres here |
/run-e2e mongodb.test* |
/run-e2e mongodb.test* |
hi @amirschw |
@amirschw thanks for this proposal. So you decided to set the metric type on the ScaledObject level, what if the type could be specified on the trigger level? (each ScaledObject/Job could have mutliple scalers). |
@zroubalik I actually set the metric type on the trigger/scaler level as proposed in #2030, not on the the ScaledObject level (or at least I think I did... 😄). See here: keda/apis/keda/v1alpha1/scaledobject_types.go Lines 121 to 132 in 5e51a85
And here: keda/pkg/scaling/scale_handler.go Lines 290 to 299 in 5e51a85
|
oh man 🤦 😄 I don't know why I thought that. I have been quite busy recently, I will try to follow up on your PR ASAP. But I think that generally it is ok. |
No worries at all :) When you do get a chance to follow up, I will be happy to get your feedback about the fourth comment in the PR description (regarding how do we make sure it works correctly for ScaledJobs). |
@amirschw Hello, we stumbled upon a business case today and we thought about contributing this change, until we found that you had a draft PR! Since every trigger on a ScaledObject can be of different type, why should this be on the ScaledObject level and on the metadata level of the trigger? Have you thought of some specific use-case? If the |
Hi @pavlospt!
Not sure I got your question. I added the new
Good question. I think it might be too big of a change to move the target value from the trigger metadata to reside directly under the trigger, especially since every trigger currently has a different name for the target value in its metadata, based on the scaler logic (e.g., |
Yeah please ignore this part, my main concern is the following question!
I understand the concers, maybe that could be a future improvement, but just for semantic reasons the fact that a type for the value is introduced, this should mean that the value as well now represents a "core" part of a trigger. It still remains a value independently of how any scaler treats it and its type is now configurable based on Just my 2 cents on that since we were discussing it with my colleagues today 😃 |
@pavlospt I see your point and agree it's worth considering it as a possible future improvement (KEDA v3? 😃) |
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! Sorry for the delay in a review.
ad 3. Could you please describe the issue you have with Fallback?
ad 4. You are right, we might probably end up with not supporting this setting for ScaledJob 🤔 ? @TsuyoshiUshio wdyt?
Thanks for the review @zroubalik! Regarding fallback: the cool thing about When |
@amirschw gotcha. We can try to pull info from the ScaleTarget in this case, to get the number of replicas. Will that help you with modification of the fallback algorithm? keda/pkg/scaling/executor/scale_scaledobjects.go Lines 254 to 256 in 4a1e358
|
@amirschw following tests:
failed with:
|
/run-e2e |
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.
LGTM!
Really, thanks for the huge effort that you have done with this PR! ❤️ ❤️
/run-e2e rabbit* |
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
@amirschw , really, KUDOS to you. You have done a great (and huge) work with this PR 🙇 Thanks again for this awesome contribution Only one more thing, could you rebase main to fix the changelog conflicts? That will also pull new AWS e2e test, and we can retrigger e2e test again testing those scalers also 🙏 |
Would be great if you could refactor that part of the code, so we create just on struct |
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
@zroubalik, @JorTurFer thanks! I was just debugging the rabbitmq failure myself and pushed a change without checking your comments. Will address your latest comments shortly 😄 |
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
Signed-off-by: amirschw <24677563+amirschw@users.noreply.github.com>
/run-e2e |
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.
We should open an issue to remove deprecated fields in the CPU/Memory scaler sometime in the future, once this get merged. |
Good idea. I opened #2844 for this. |
LGTM too! |
Add support for
ValueMetricType
in all scalers except cpu/memory by introducing a new optionalmetricType
field to the ScaleTrigger spec. The field will default toAverageValueMetricType
to maintain backward compatibility.Notes:
Utilization
metric type is not supported for external metrics, onlyValue
orAverageValue
.Utilization
andAverageValue
metric types.AverageValue
metric type only.Checklist
Fixes #2030.
Signed-off-by: amirschw 24677563+amirschw@users.noreply.github.com