keda icon indicating copy to clipboard operation
keda copied to clipboard

Composed (Logical/Priority) Triggers

Open theauheral opened this issue 2 years ago • 12 comments

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 avatar Jul 05 '22 12:07 theauheral

hey @theauheral Could this be duplicated? https://github.com/kedacore/keda/issues/2614

JorTurFer avatar Jul 05 '22 12:07 JorTurFer

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.

theauheral avatar Jul 05 '22 16:07 theauheral

Yes, you are right. I link this too because this is more related (https://github.com/kedacore/keda/issues/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

JorTurFer avatar Jul 05 '22 18:07 JorTurFer

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.

zroubalik avatar Jul 11 '22 10:07 zroubalik

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[bot] avatar Sep 09 '22 13:09 stale[bot]

Keep-Alive

tomkerkhove avatar Sep 09 '22 18:09 tomkerkhove

@tomkerkhove any update on this?

miqm avatar Apr 03 '24 18:04 miqm