kedacore / samples

Place for community to contribute samples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help configure Keda HPA based on AWS/EC2 CloudWatch CPUUtilization trigger type

AAber opened this issue · comments

This is what I have so far:

kind: Secret
metadata:
  name: keda-aws-secrets
data:
  AWS_ACCESS_KEY_ID: XXXXXXXXXXXXXXXXXXXX
  AWS_SECRET_ACCESS_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
---
apiVersion: keda.k8s.io/v1alpha1
kind: TriggerAuthentication
metadata:
  name: keda-trigger-auth-aws-credentials
  namespace: keda
spec:
  secretTargetRef:
  - parameter: awsAccessKeyID     # Required.
    name: keda-aws-secrets        # Required.
    key: AWS_ACCESS_KEY_ID        # Required.
  - parameter: awsSecretAccessKey # Required.
    name: keda-aws-secrets        # Required.
    key: AWS_SECRET_ACCESS_KEY    # Required.
---
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
  name: aws-cloudwatch-cpu-scaledobject
  namespace: keda
  labels:
    test: gateway-app
spec:
  scaleTargetRef:
    deploymentName: gateway-app
  triggers:
  - type: aws-cloudwatch
    metadata:
      namespace: AWS/EC2
      dimensionName: AutoScalingGroupName
      dimensionValue: eksctl-us-east-1-app-spot-ng-XXXXXXXXXXXXX
      metricName: CPUUtilization
      statistic: Average
      period: "180"
      evaluationPeriods: "1"
      threshold: "80"
      comparisonOperator: GreaterThanThreshold
      alarmActions: scaleUp
      awsRegion: "us-east-1"
    authentication/Ref:
      name: keda-trigger-auth-aws-credentials````

I saw the SQS trigger type sample but I don't know what metadata to use for the aws-cloudwatch trigger type.
Please advise if possible and how to configure.

Thanks.