Skip to Content

Workload Identity Setup
Available in v1.26.11+

ScaleOps reads AWS node and pricing data with a role in your account. Use IAM Roles for Service Accounts (IRSA) or EKS Pod Identity. Neither option stores IAM keys in the cluster.

IRSA uses the cluster OIDC provider and the eks.amazonaws.com/role-arn annotation. EKS Pod Identity (v1.35.5+) uses the EKS Pod Identity Agent  and does not use that annotation. Use one of them.

Prerequisites

  • AWS CLI installed and configured
  • kubectl access to your EKS cluster
  • For IRSA: EKS cluster with an OIDC identity provider
  • For EKS Pod Identity: the EKS Pod Identity Agent add-on on the cluster

Step 1: Create IAM Policy

First, create the IAM policy for node integration permissions. NodeConsolidation holds the write actions. NodeIntegrationReadAccess is read-only. For the optional self-managed Auto Scaling Group clone permissions, see Architecture.

# Create the IAM policy aws iam create-policy \ --policy-name scaleops-node-integration-access-policy \ --policy-document '{ "Version": "2012-10-17", "Statement": [ { "Sid": "NodeConsolidation", "Effect": "Allow", "Action": [ "autoscaling:CreateAutoScalingGroup", "autoscaling:DeleteAutoScalingGroup", "autoscaling:SetDesiredCapacity", "autoscaling:TerminateInstanceInAutoScalingGroup", "autoscaling:UpdateAutoScalingGroup", "autoscaling:CreateOrUpdateTags", "autoscaling:SuspendProcesses", "ec2:CreateLaunchTemplate", "ec2:DeleteLaunchTemplate", "ec2:RunInstances", "eks:CreateNodegroup", "eks:DeleteNodegroup", "eks:TagResource", "eks:UpdateNodegroupConfig" ], "Resource": "*" }, { "Sid": "NodeIntegrationReadAccess", "Effect": "Allow", "Action": [ "athena:Get*", "athena:List*", "autoscaling:Describe*", "autoscaling:Get*", "bedrock:Get*", "bedrock:List*", "ce:Describe*", "ce:Get*", "ce:List*", "cloudwatch:GetMetricData", "cloudwatch:GetMetricStatistics", "cloudwatch:ListMetrics", "cloudwatch:DescribeAlarms", "compute-optimizer:Describe*", "compute-optimizer:Get*", "dynamodb:Describe*", "dynamodb:List*", "ec2:Describe*", "ec2:Get*", "ec2:List*", "ecs:Describe*", "ecs:List*", "eks:Describe*", "eks:List*", "elasticache:Describe*", "elasticache:List*", "elasticloadbalancing:Describe*", "glue:Get*", "glue:List*", "lambda:GetFunction", "lambda:GetFunctionConfiguration", "lambda:List*", "organizations:Describe*", "organizations:List*", "rds:Describe*", "rds:List*", "s3:GetBucketLocation", "s3:GetBucketTagging", "s3:ListAllMyBuckets", "sagemaker:Describe*", "sagemaker:List*", "tag:GetResources", "tag:GetTagKeys", "tag:GetTagValues", "pricing:GetProducts", "pricing:DescribeServices", "pricing:GetAttributeValues", "ecr:DescribeRepositories", "ecr:ListTagsForResource", "ecr:GetRepositoryPolicy", "savingsplans:DescribeSavingsPlans", "savingsplans:DescribeSavingsPlansOfferings", "savingsplans:DescribeSavingsPlanRates" ], "Resource": "*" }, { "Sid": "SimulateIAM", "Effect": "Allow", "Action": [ "iam:SimulatePrincipalPolicy", "iam:SimulateCustomPolicy", "iam:GetRole", "iam:ListAttachedRolePolicies" ], "Resource": "*" }, { "Sid": "PassNodeRole", "Effect": "Allow", "Action": "iam:PassRole", "Resource": "*", "Condition": { "StringEquals": { "iam:PassedToService": [ "eks.amazonaws.com", "ec2.amazonaws.com" ] } } }, { "Sid": "MarketplaceTagging", "Effect": "Allow", "Action": [ "ec2:CreateTags" ], "Resource": "arn:aws:ec2:*:*:volume/*" } ] }' > /dev/null

Step 2: Create IAM Role for Each EKS Cluster

For each EKS cluster that needs node integration, create a separate IAM role with the appropriate trust policy.

# Get your EKS cluster OIDC issuer URL CLUSTER_ISSUER=$(aws eks describe-cluster --name <CLUSTER_NAME> --region <REGION> --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///") # Get your AWS account ID ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) # Create the IAM role ROLE_NAME="node-integration-workload-identity-role" aws iam create-role \ --role-name $ROLE_NAME \ --assume-role-policy-document "{ \"Version\": \"2012-10-17\", \"Statement\": [ { \"Effect\": \"Allow\", \"Principal\": { \"Federated\": \"arn:aws:iam::${ACCOUNT_ID}:oidc-provider/${CLUSTER_ISSUER}\" }, \"Action\": \"sts:AssumeRoleWithWebIdentity\", \"Condition\": { \"StringEquals\": { \"${CLUSTER_ISSUER}:sub\": [ \"system:serviceaccount:scaleops-system:scaleops-agent\", \"system:serviceaccount:scaleops-system:scaleops-dashboards\", \"system:serviceaccount:scaleops-system:scaleops-recommender\", \"system:serviceaccount:scaleops-system:scaleops-updater\" ], \"${CLUSTER_ISSUER}:aud\": \"sts.amazonaws.com\" } } } ] }" > /dev/null # Attach the policy to the role aws iam attach-role-policy \ --role-name $ROLE_NAME \ --policy-arn arn:aws:iam::$ACCOUNT_ID:policy/scaleops-node-integration-access-policy > /dev/null

Step 3: Configure ScaleOps Helm Values

Grab the role ARN from the output of the above command.

ROLE_NAME="node-integration-workload-identity-role" aws iam get-role --role-name $ROLE_NAME --query "Role.Arn" --output text

For each cluster, configure the Helm values to use workload identity:

global: serviceAccount: annotations: eks.amazonaws.com/role-arn: "<ROLE_ARN>" cloudNodeIntegration: aws: enabled: true

EKS Pod Identity
Available in v1.35.5+

Use this path when the cluster uses EKS Pod Identity instead of IRSA. Complete Step 1 first so the scaleops-node-integration-access-policy policy exists. Then create a role the Pod Identity Agent can assume, and associate it with the ScaleOps service accounts.

Install the EKS Pod Identity Agent

Skip this when the add-on is already installed.

aws eks create-addon \ --cluster-name <CLUSTER_NAME> \ --region <REGION> \ --addon-name eks-pod-identity-agent

Create the IAM role

ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) ROLE_NAME="node-integration-pod-identity-role" aws iam create-role \ --role-name $ROLE_NAME \ --assume-role-policy-document '{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "pods.eks.amazonaws.com" }, "Action": [ "sts:AssumeRole", "sts:TagSession" ] } ] }' > /dev/null aws iam attach-role-policy \ --role-name $ROLE_NAME \ --policy-arn arn:aws:iam::$ACCOUNT_ID:policy/scaleops-node-integration-access-policy

Associate the role with ScaleOps

scaleops-system is the default ScaleOps namespace. Change SCALEOPS_NAMESPACE when ScaleOps is installed elsewhere. Create one association per service account. They can share the same role.

ROLE_NAME="node-integration-pod-identity-role" ROLE_ARN=$(aws iam get-role --role-name $ROLE_NAME --query "Role.Arn" --output text) SCALEOPS_NAMESPACE="scaleops-system" for SA in scaleops-agent scaleops-dashboards scaleops-recommender scaleops-updater; do aws eks create-pod-identity-association \ --cluster-name <CLUSTER_NAME> \ --region <REGION> \ --namespace $SCALEOPS_NAMESPACE \ --service-account $SA \ --role-arn $ROLE_ARN done

Configure ScaleOps Helm values

Do not set eks.amazonaws.com/role-arn. ScaleOps detects the Pod Identity credentials from the pod environment and uses the associated role for permission checks.

cloudNodeIntegration: aws: enabled: true