Use two triggers in the Keda's ScaledObject
CodeWithVed
Posted on September 18, 2024
As mentioned in this article
Scale Deployments Based on HTTP Requests with Keda
CodeWithVed ・ Sep 17
#keda
#autoscaling
#performance
#aws
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>
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.
💖 💪 🙅 🚩
CodeWithVed
Posted on September 18, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.