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.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more