DEV Community

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

Posted on

1

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.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay