KEDA HPA metrics value for Queue Triggered Azure Function

Viewed 129

I have a KEDA enabled Queue Triggered Azure Function running in a Kubernetes cluster. When I describe the HPA created by KEDA, I am unable to understand the value metrics.

In the following image, what does "7309m" represents? I came to the conclusion that "1" is the queueLength parameter I supplied in the ScaledObject.yaml file. enter image description here

The official documentation shows an example which is based upon the percentage of the resources utilized by the system as follows: enter image description here

ScaledObject.yaml file

apiVersion: v1
kind: Secret
metadata:
  name: queue-connection-secret
data:
  connection-string: ####
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
  name: azure-queue-auth
spec:
  secretTargetRef:
  - parameter: connection
    name: queue-connection-secret
    key: connection-string
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: queuetrigfuncscaledobject
spec:
  scaleTargetRef:
    name: queuetrigfuncdeployment
  minReplicaCount: 0
  maxReplicaCount: 120
  pollingInterval: 1
  cooldownPeriod: 900

  triggers:
  - type: azure-queue
    metadata:
      queueName: k8s-poc-queue
      queueLength: "1"
    authenticationRef:
        name: azure-queue-auth
1 Answers

The queueLength specifies the target amount of messages you want to see on each pod in k8s. Simply saying it's the amount you want to achieve while scaling the number of pods. Specifying it as 1 will make HPA scale the pods to the number of messages in the queue, which isn't what you want to achieve I assume. There is an official doc available here https://keda.sh/docs/2.4/scalers/azure-storage-queue/

Related