githubEdit

AWS IRSA (EKS)

Configure IAM Roles for Service Accounts (IRSA) for Spice.ai on Amazon EKS.

IAM Roles for Service Accounts (IRSA) allows Spice.ai pods on Amazon EKS to assume an IAM role for accessing AWS services (S3, Secrets Manager, DynamoDB, etc.) without managing static credentials.

How It Works

The AWS SDK credential provider chain automatically uses STS Web Identity Token Credentials when a pod runs under an IRSA-annotated ServiceAccount. The SDK calls sts:AssumeRoleWithWebIdentity to retrieve temporary credentials.

Credential chain order:

  1. Environment variables

  2. Shared credentials/config files

  3. STS Web Identity (IRSA)

  4. ECS container credentials

  5. EC2 instance metadata (IMDSv2)

Prerequisites

  • An EKS cluster with an OIDC providerarrow-up-right

  • An IAM role with the correct trust policy

  • The Spice Kubernetes Operator installed via Helm

Step 1: Create IAM Role with IRSA Trust Policy

Replace ACCOUNT_ID, REGION, CLUSTER_ID, NAMESPACE, and SERVICE_ACCOUNT_NAME with your values.

Step 2: Attach IAM Policies

Attach policies for the AWS services your Spicepod connects to:

Use Case
Required IAM Actions

S3 data sources

s3:GetObject, s3:ListBucket

Secrets Manager

secretsmanager:GetSecretValue

DynamoDB

dynamodb:GetItem, dynamodb:Query, dynamodb:Scan

Step 3: Configure the SpicepodSet

Operator-Managed ServiceAccount

Using an Existing ServiceAccount

Helm Chart (Enterprise)

Operator ServiceAccount via Helm

To grant the operator itself AWS access (for example, to pull images from ECR):

EKS Pod Identity (Alternative)

EKS Pod Identityarrow-up-right is a simpler alternative to IRSA that uses the EKS Pod Identity Agent add-on. The IAM role association is managed via the EKS API — no ServiceAccount annotation is needed.

Last updated

Was this helpful?