vinod827
vinod827

Reputation: 1544

How to add multiple triggers in Kubernetes KEDA scaledobject

I'm using KEDA to scale my pods on EKS cluster. I want to have trigger enabled on both CPU and Memory based scalers in the ScaledObject so here is my code chunk:-

spec:
  scaleTargetRef:
    name: workload-processor
  cooldownPeriod: 120
  minReplicaCount: 1
  maxReplicaCount: 3
  triggers:
  - type: cpu
    metadata:
      type: AverageValue
      value: "70"
  - type: memory
    metadata:
      type: AverageValue
      value: "70"

I'm trying to use both types of triggers (cpu and memory) here in same YAML file. When I run the kubectl get scaledobject command then it shows triggers enabled only on CPU but not on both including memory:-

NAME                          SCALETARGETKIND      SCALETARGETNAME   MIN   MAX   TRIGGERS   AUTHENTICATION   READY   ACTIVE   FALLBACK   AGE
workload-processor-keda-scaler   apps/v1.Deployment   workload-processor   1     3     cpu                         True    True     Unknown 

Am I doing anything mistake here? How can I enable the trigger for both? Should I write two separate scaledobject YAML files (one for CPU and another for Memory)?

Upvotes: 1

Views: 4588

Answers (1)

vinod827
vinod827

Reputation: 1544

Functionally it has got all the triggers when I do kubectl get scaledobject -o yaml. The problem is with the CRD itself as it is not able to display all the triggers on CLI. It is an existing bug and have been already reported here https://github.com/kedacore/keda/issues/1943

Upvotes: 3

Related Questions