Overview of the IRSA Authentication Flow
- EKS provisions an OIDC identity provider for the cluster.
- You create an IAM role with a trust policy for that OIDC provider.
- EKS injects a mutating webhook into the control plane.
- You annotate a Kubernetes ServiceAccount with the IAM role’s ARN.
- When your pod starts, the webhook mounts a projected token and sets AWS environment variables.
- The AWS SDK inside the pod:
- Retrieves a JWT from the OIDC provider.
- Calls STS
AssumeRoleWithWebIdentityusing that JWT. - Receives temporary AWS credentials.
- Your application uses those credentials to call S3.
1. Configure the OIDC Provider
When you create an EKS cluster, AWS automatically registers an OIDC identity provider. Retrieve its issuer URL:2. Create an IAM Role with Trust Policy
Define a trust policy that allows your EKS OIDC provider to assume the role:Replace the OIDC issuer URL, AWS account ID, and Kubernetes namespace/serviceaccount in the trust policy to match your environment.
3. EKS Mutating Webhook Injection
EKS deploys a mutating webhook that intercepts pod creation. It mounts a projected service account token and injects AWS environment variables (AWS_ROLE_ARN, AWS_WEB_IDENTITY_TOKEN_FILE, etc.) into pods that reference an annotated ServiceAccount.

4. Annotate a Kubernetes ServiceAccount
Create a ServiceAccount annotated with your IAM role ARN:5. Runtime Token Exchange
- Pod mounts the projected token and sets AWS variables.
- AWS SDK fetches a JWT from the EKS OIDC provider.
- It calls STS
AssumeRoleWithWebIdentitywith the token. - STS validates the token against the IAM role’s trust policy.
- STS returns temporary AWS credentials.
- The application uses these credentials to access S3.
6. Scalability and Operational Considerations
If you run more than 100 EKS clusters in one AWS account, you will hit the OIDC provider limit. Consider using fewer providers or multiple AWS accounts.


7. When to Use IRSA
IRSA is ideal when you need per-pod, least-privilege AWS access without distributing node IAM keys. However, at scale or in multi-cluster deployments, managing OIDC providers and IAM roles can become complex.- Use IRSA when
- You require tight access control per ServiceAccount.
- You want to eliminate node-wide IAM credentials.
- Consider alternatives when
- Your cluster fleet exceeds OIDC limits.
- You prefer a simpler EC2 metadata or sidecar proxy solution.
AWS EKS Pod Identity provides another AWS-native approach that may scale better in large, multi-region environments.
Links and References
- Amazon EKS Documentation
- Kubernetes ServiceAccount
- AWS STS AssumeRoleWithWebIdentity API
- Setting Up IAM Roles for Service Accounts (IRSA)