Skip to content

Instantly share code, notes, and snippets.

@eftalyurtseven
Last active June 25, 2022 19:01
Show Gist options
  • Save eftalyurtseven/80450d6c36dc2cfdbff06c8d9e2cf863 to your computer and use it in GitHub Desktop.
Save eftalyurtseven/80450d6c36dc2cfdbff06c8d9e2cf863 to your computer and use it in GitHub Desktop.
Scaledobject Example With SQS
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: aws-sqs-queue-scaledobject
namespace: keda-test
spec:
scaleTargetRef:
name: nginx-deployment
minReplicaCount: 0 # If the queue is empty we'll downscale to 0
maxReplicaCount: 5 # If queue size is more bigger than we think, KEDA will scale our pods maximum 5
pollingInterval: 10 # How frequently we should go for metrics (in seconds)
cooldownPeriod: 25 # How many seconds should we wait for downscale
triggers:
- type: aws-sqs-queue # You can use lots of trigger type, for more information please visit keda.sh
authenticationRef:
name: keda-aws-credentials  # We'll create after
metadata:
queueURL: https://sqs.<AWS_REGION>.amazonaws.com/<AWS_ACCOUNT_ID>/test-queue
queueLength: "2"
awsRegion: "<AWS_REGION>"
identityOwner: operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment