Skip to content
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

Composed (Logical/Priority) Triggers #3330

Open
theauheral opened this issue Jul 5, 2022 · 11 comments
Open

Composed (Logical/Priority) Triggers #3330

theauheral opened this issue Jul 5, 2022 · 11 comments
Labels
feature-request All issues for new features that have not been committed to needs-discussion stale-bot-ignore All issues that should not be automatically closed by our stale bot

Comments

@theauheral
Copy link

Proposal

I would like to suggest a new feature: composed (Logical/Priority) triggers.

Use-Case

I would like to be able to compose triggers or define a logic/priority between triggers.

Example:
Scaling from 0 to 1<=n<=maxReplicas replicas on a fixed CRON schedule (On/Off) with n managed by the metric (kafka) trigger during the runtime window.

The current design only enables "OR" logic between triggers. I would like to specify an "AND" logic between triggers or a priority of evaluation between triggers. Check trigger 1, if true then check trigger 2.

Anything else?

Specification

  • AND logic between triggers
  • Alternatively, define priority triggers
  • Probably most rigorous, creating a composed trigger class enabling the above two

Possible inspiration: Log4J2 rules and triggers for rotating files based on time and file size

@theauheral theauheral added feature-request All issues for new features that have not been committed to needs-discussion labels Jul 5, 2022
@JorTurFer
Copy link
Member

hey @theauheral
Could this be duplicated? #2614

@theauheral
Copy link
Author

theauheral commented Jul 5, 2022

Hello @JorTurFer,

Yes maybe. Different use cases but same technical implementation I suspect. I would say related but not identical.

I see "Combination of triggers can be used, either with an OR or AND fashion." which is similar yes.
but I also suggest priorities and composability. I guess #2614 has two feature requests with the second one being similar.
The example of Microsoft Azure autoscale has multiple rules but not composed rules.

You could definitely build the two feature requests in one.

@JorTurFer
Copy link
Member

Yes, you are right.
I link this too because this is more related (#2440).
Just to clarify this a bit, KEDA delegates the scaling to the HPA Controller so applying an AND or prioritize the metrics it's not possible. The only doable option is the creation of composite scaler IMO

@zroubalik
Copy link
Member

Yeah, what we can do is to provide just one metric to HPA in this case and calculate the formula consisting of multiple triggers on KEDA side.

@stale
Copy link

stale bot commented Sep 9, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Sep 9, 2022
@zroubalik zroubalik added the stale-bot-ignore All issues that should not be automatically closed by our stale bot label Sep 9, 2022
@stale stale bot removed the stale All issues that are marked as stale due to inactivity label Sep 9, 2022
@tomkerkhove
Copy link
Member

Keep-Alive

@miqm
Copy link

miqm commented Apr 3, 2024

@tomkerkhove any update on this?

@ghantasunil
Copy link

@tomkerkhove, any update on this?

@tomkerkhove
Copy link
Member

Nope, are you willing to contribute it?

@zroubalik
Copy link
Member

This is already covered by Scaling Modifiers https://keda.sh/docs/2.14/concepts/scaling-deployments/#scaling-modifiers-experimental

I belive we can close this issue already.

@ghantasunil
Copy link

Hi @zroubalik,

I have a use case where I need to scale my application in and out based on the Azure Service Bus queue length and Azure SQL CPU. Below is the condition I am planning to use for scaling. How can I implement this using Scaling Modifiers? I plan to use the Azure Service Bus scalar to get the queue length and the Azure Monitor scalar to monitor the Azure SQL Managed Instance CPU. Appreciate your help. Thanks.

Scaling Out Condition: Scale out when both conditions are met:

  • Azure Service Bus queue length > 500 messages
  • Azure SQL Managed Instance CPU < 80%

Scaling In Condition: Scale in when any of the following conditions are true:

  • Azure Service Bus queue length <= 500 messages
  • Azure SQL Managed Instance CPU >= 80%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion stale-bot-ignore All issues that should not be automatically closed by our stale bot
Projects
Status: No status
Development

No branches or pull requests

6 participants