DEV Community

Cover image for Use two triggers in the Keda's ScaledObject
CodeWithVed
CodeWithVed

Posted on

Use two triggers in the Keda's ScaledObject

As mentioned in this article


Following it, instead of just a single trigger, you can also use multiple triggers that KEDA ScaledObject supports. For more information, please refer to this official article:
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: <ScaledObjectName>
spec:
  maxReplicaCount: 10
  minReplicaCount: 1
  pollingInterval: 10
  scaleTargetRef:
    name: <DeploymentName>
  triggers:
    - type: aws-cloudwatch
      name: <Name>
      authenticationRef:
        name: <AwsCredentialName>
      metadata:
        namespace: "CWAgent"
        dimensionName: <DimensionName1;DimensionName2>
        dimensionValue: <DimensionValue1;DimensionValue2>
        metricName: <MetricsName>
        metricEndTimeOffset: "10"
        metricCollectionTime: "10"
        targetMetricValue: "1000"
        minMetricValue: "0"
        metricStat: "Sum"
        metricStatPeriod: "10"
        awsRegion: "us-east-1"
    - type: cpu
      metadata:
        type: Utilization
        value: <Utilization-Percentage>


Enter fullscreen mode Exit fullscreen mode

Earlier parameters for CloudWatch trigger explanation can be referred to above mentioned article. Here, I have only added the trigger cpu. Inside metadata.type, you have two options: Utilization and Average. At a high level, Utilization refers to the percentage, and Average requires the specific value of CPU above which it will start scaling instances.

Top comments (0)