Skip to content

Support IRSA for SQS Scalar #837

@NasAmin

Description

@NasAmin

A clear and concise description of what you want to happen.

We use EKS as our kubernetes cluster. To allow our pods to authenticate against AWS to access AWS services, we use IAM Roles for Service Accounts (IRSA). We'd like to use the same approach on the KEDA operator so the scalar can get AWS authentication from the operator.

Specification

  • I have enabled IRSA on the service account for the KEDA operator on my EKS cluster
  • This means that the service account is annotated with an IAM role.
  • KEDA operator was deployed using the Helm chart
  • I have deployed the SQS scalar with the following config
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
  name: sqs-queue-scaledobject
  namespace: default
  labels:
    test: my-deployment
spec:
  scaleTargetRef:
    deploymentName: my-deployment
  minReplicaCount: 1
  maxReplicaCount: 10
  pollingInterval: 5
  triggers:
  - type: aws-sqs-queue
    metadata:
      # Required: queueURL
      queueURL: https://sqs.eu-west-2.amazonaws.com/someaccount/cluster-AuditEventsQueue
      queueLength: "5"  # Default: "5"
      # Required: awsRegion
      awsRegion: "eu-west-2" 
      identityOwner: operator 
  • An HPA is created automatically but it gives the following error
arning  FailedGetExternalMetric       81s (x60 over 16m)  horizontal-pod-autoscaler  unable to get external metric default/AWS-SQS-Queue-ApproximateNumberOfMessages-cluster-AuditEventsQueue/&LabelSelector{MatchLabels:map[string]string{deploymentName: my-deployment,},MatchExpressions:[],}: unable to fetch metrics from external metrics API: No matching metrics found for aws-sqs-queue-approximatenumberofmessages-cluster-auditeventsqueue
  • I have enabled debug logs on the operator and I am seeing this error
 {"level":"debug","ts":1589916310.2131512,"logger":"scalehandler","msg":"Error getting scale decision","ScaledObject.Namespace":"default","ScaledObject.Name":"my-sqs-queue-scaledobject","ScaledObjec ││ t.ScaleType":"deployment","Error":"WebIdentityErr: unable to read file at /var/run/secrets/eks.amazonaws.com/serviceaccount/token\ncaused by: open /var/run/secrets/eks.amazonaws.com/serviceaccount/token: p ││ ermission denied"}

I suspect this may be because the SQS scalar isn't using the right SDK version

I'd really appreciate some help with this.

Regards

Nas

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportAll issues related to questions and supporting customers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions