azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

No scaler found for timertrigger. func deploy generated scaledobject

Open CarlosLanderas opened this issue 4 years ago • 12 comments

Hello, I am trying to deploy to kubernetes an Azure Functions v3 project that has several Http Functions and one TimerTrigger function, and I see the created scaled object is the one below after executing the following command:

func kubernetes deploy --name timered --registry localhost:5000 --namespace

The default configured replicas are zero

    uid: a8cdf04d-178f-4cdd-8add-aa455219cf28
  spec:
    maxReplicaCount: 5
    minReplicaCount: 1
    pollingInterval: 5
    scaleTargetRef:
      deploymentName: timered
    triggers:
    - metadata:
        name: myTimer
        schedule: '*/5 * * * * *'
        type: timerTrigger
      type: timertrigger
kind: List

I do not know what is the purpose of creating a trigger with type "timertrigger", as It seems it does not exist in keda, or maybe I am missing something?

The logs of the keda operator reflect the following error, and the deployment always has zero replicas.

"Reconciler error","controller":"scaledobject-controller","request":"delete/timered","error":"error getting scaler for trigger #0: no scaler found for type: timertrigger"

Are timertriggers thought to be working with ScaledObjects? Or can we get rid of the scaled object definition and just use an standard HPA and configure replicas in the deployment?

Thanks

CarlosLanderas avatar Apr 06 '20 17:04 CarlosLanderas

@jeffhollan @ahmelsayed Do you know if we support timers in Keda?

anthonychu avatar Apr 07 '20 18:04 anthonychu

KEDA doesn’t do azure functions style timer triggers yet.

ahmelsayed avatar Apr 07 '20 18:04 ahmelsayed

Then, I suppose it would be a great option not generating the scaledobject for non keda scaler supported types:

https://github.com/Azure/azure-functions-core-tools/blob/8cbebb5264a2b21599031325c684fde0dabf3c7c/src/Azure.Functions.Cli/Kubernetes/KubernetesHelpers.cs#L685

Or at least offer an option in the cli to enable/disable the ScaledObject creation, as this scaledobject that is created in the cluster when deploying with az func is causing the operator to handle and fail the trigger all the time.

"Reconciler error","controller":"scaledobject-controller","request":"delete/timered","error":"error getting scaler for trigger #0: no scaler found for type: timertrigger"

Maybe something like: func kubernetes deploy [args] --create-scaledobject false or --no-scaledobject

I do not know what do you think is the best option

CarlosLanderas avatar Apr 07 '20 18:04 CarlosLanderas

/cc @SatishRanjan

ahmelsayed avatar Apr 07 '20 19:04 ahmelsayed

Keda 1.5 will have a Cron scaler, will it be supported then? https://keda.sh/docs/2.0/scalers/cron/

IvanJosipovic avatar Jun 16 '20 06:06 IvanJosipovic

I think we can support it with the new scaler. There will be an implicit assumption there that the function can't take more than the cooldownPeriod. In consumption plan on Azure, that's 10 minutes. In Keda that's defaulted to 5 minutes, but the core-tools can default it to 10 to make the behavior similar.

ahmelsayed avatar Jun 16 '20 19:06 ahmelsayed

The Cron scalar has now been released in KEDA version 1.5.0

IvanJosipovic avatar Jul 27 '20 01:07 IvanJosipovic

There is a difference in the CRON approach though. In KEDA we define a window to ramp up pods in, while here it indicates when a new run should happen.

tomkerkhove avatar Oct 19 '20 05:10 tomkerkhove

Hello, guys

Any progress?

fabianedl777 avatar Mar 02 '21 18:03 fabianedl777

Also checking to see if there is an update on this.

SultanSGillani avatar Mar 19 '21 16:03 SultanSGillani

I just noticed the func created timertrigger and my Keda doesn't like it.

KEDAScalerFailed
no scaler found for type: timertrigger

What's the status on this? What's the workaround?

It seems like it's safe to delete the timertrigger scaled obj, the function is handling the timing internally as long as its min 1?

teebu avatar Aug 22 '22 20:08 teebu