Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Keda Scaler Support for Azure Functions Is Really Non-Existent even Though Func Tooling/Docs Gives the Impression that Scaling Is Supported

Open SOFSPEEL opened this issue 11 months ago • 1 comments

Please describe the documentation request or issue. Be as specific as possible.

So have a function app and deploy it to aks via .yaml file using the func tooling as follows:

func kubernetes deploy --name processtransaction --registry blah --dry-run >deploy-processtransaction.yaml Below is an excerpt of the .yaml produced, here are the myriad of problems:

  • There is no timertrigger scaler support in keda
  • There is no durable function/orchestration support, and here I'm making some assumptions, if I was designing scaler support for Function apps, it would have to know whether a long-running orchestration has completed or not. i.e. before you can scale down you have to know whether the orchestration has completed or not.
  • The documentation gives you the impression that Azure function apps are supported: https://learn.microsoft.com/en-us/azure/azure-functions/functions-kubernetes-keda
  • The tooling gives you the impression that scaling is supported, i.e. why would the tooling create a timertrigger if it wasn't supported by keda (either by built-in or external scaler)
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: procreqs
  labels: {}
spec:
  scaleTargetRef:
    name: procreqs
  triggers:
  - type: cosmosdbtrigger
    metadata:
      connection: CosmosConnection
      leaseContainerName: leases
      leaseContainerPrefix: '%AZURE_FUNCTIONS_ENVIRONMENT%'
      containerName: ProcessingRequest
      databaseName: FundraisingGateway
      leaseDatabaseName: FundraisingGateway
  - type: timertrigger
    metadata:
      schedule: 0 0 0/1 * * *
  - type: timertrigger
    metadata:
      schedule: 0 10/20 * * * *
---

Expected Behavior

  • that scaling is supported under aks, and that orchestrations are part of that support. i.e. I would guess that 90% of fn apps use orchestration.

  • that the documentation is improved and mentions orchestrations and the support (or lack thereof) for orchestrations. Orchestrations to me are a show stopper as basically in my mind scaling doesn't work unless it supports orchestrations.

  • If you really do not support scaling to not have the tooling generate stuff like timertrigger as I'm sure this has sent many a deVeloper like myself down a black hole either thinking that scaling is supported (when its not) or trying to fix (the unfixable). Note that I may not have made the decision to convert my fn app to run under aks without proper scaler support.

  • Provide a timeline for when scaling will be supported.

Actual Behavior

Scaling doesn't work, like for example the timertrigger mentioned above and orchestrations, meaning that pods don't scale up or down.

Steps to Reproduce the Problem

Run func on a function app with timertrigger kicking off an orchestration. Deploy it to aks. Watch no scaling will occur, what should happen is that replicas should go to zero, when timer not running, then scale up, then scale down when orchestration completes.

SOFSPEEL avatar Mar 29 '24 00:03 SOFSPEEL