EKS Pod Identity vs IRSA: How Credentials Reach Pods and Which to Choose
EKS Pod Identity vs IRSA comes down to one question: who vouches for your pod when it asks AWS for credentials? This guide compares the OIDC token exchange behind IRSA with the agent and association flow behind EKS Pod Identity, then walks IAM trust policies, credential-chain precedence, a no-outage migration path, and the AccessDenied and no-credentials failures that show up at 2 a.m., so you can pick the right model and debug it when it breaks.
1. What EKS Pod Identity vs IRSA actually decides
EKS Pod Identity vs IRSA is a choice about who vouches for a pod when it asks AWS for credentials. IRSA lets the pod present a cluster-signed OIDC token straight to STS. Pod Identity sends the request through a node-local agent and the EKS Auth service instead. Both end at a scoped IAM role.
Illustrative composite: a platform team migrates a payments API from IRSA to Pod Identity on a Tuesday afternoon. The association exists, the role trust policy looks right, and the rollout completes without a single failed pod. An hour later the API starts returning errors on S3 writes. CloudTrail shows the caller is not the payments role at all. It is the node group role, shared by every pod on those nodes. Nothing crashed, nothing logged a credential error at startup, and the pods stayed Ready the whole time. The migration had created the association after the pods were already running, so the new pods from an unrelated deploy picked up Pod Identity while the older replica set kept falling back to instance metadata. That split-brain state, half the fleet on one identity and half on another, is the defining failure of this topic, and it is why this guide starts with mechanism before configuration.
Both mechanisms exist to kill the same bad default: pods borrowing the EC2 node role. The node role is shared by every pod scheduled on that node, it usually carries permissions accumulated for node plumbing, and it turns any single compromised container into a node-wide credential. IRSA and Pod Identity both replace that with a per-workload IAM role and short-lived credentials. Where they differ is the trust path. IRSA builds trust between IAM and your cluster's OIDC issuer, and the pod talks to STS itself. Pod Identity builds trust between IAM and an AWS service principal, and a node-local agent plus the EKS Auth service do the talking. Almost every operational difference in this guide, from migration order to the exact error message you will see, follows from that one architectural split.
Keep the ownership split in mind as well. With IRSA, the mapping from service account to role lives partly in your cluster (an annotation) and partly in IAM (a trust policy). With Pod Identity, the mapping lives in the EKS API as an association object, and IAM only holds the role and its permissions. That changes who can change a workload's AWS identity, what shows up in audit logs, and which team gets paged when it breaks. The AWS IAM Identity Center and multi-account guide covers the human side of IAM; this guide stays on the workload side, inside EKS.
2. How IRSA works in EKS Pod Identity vs IRSA: the OIDC token flow
In EKS Pod Identity vs IRSA, IRSA is the OIDC path: the cluster signs a projected service-account token, a webhook injects it into the pod, and the AWS SDK exchanges it with STS using AssumeRoleWithWebIdentity. IAM validates the token against the cluster's registered OIDC provider, then checks the role trust policy.
Three primitives carry the whole mechanism, and each one fails independently. First, the cluster's OIDC issuer. Every EKS cluster publishes an issuer URL with a JWKS endpoint holding the public keys that sign service-account tokens. That issuer does nothing until you register it as an IAM OIDC identity provider in the AWS account. Registration is per cluster and per account, which is the root of IRSA's scaling friction: ten clusters means ten providers, and every role trust policy names the providers it accepts. Skip the registration and every token exchange fails with an InvalidIdentityToken error saying no OpenID Connect provider was found in the account.
Second, the projected token. When a pod uses a service account annotated witheks.amazonaws.com/role-arn, the EKS mutating webhook injects a projected token volume and two environment variables at pod creation: AWSROLEARN and AWSWEBIDENTITYTOKENFILE. The token is a JWT with three claims that matter. The iss claim is the cluster issuer. The aud claim is pinned to sts.amazonaws.com. The sub claim is system:serviceaccount:<namespace>:<service-account-name>. Kubelet rotates the projected token before expiry, so the pod never holds a long-lived credential, only a short-lived proof of identity it can trade in.
Third, the STS exchange. The SDK reads the token file, calls sts:AssumeRoleWithWebIdentity, and STS verifies the signature against the OIDC provider's keys, checks the audience, then evaluates the role's trust policy. If the trust policy allows that exact sub from that exact issuer, STS returns temporary credentials. Note the timing: the webhook acts only when a pod is created. Annotating a service account changes nothing for running pods, which is why so many IRSA fixes appear to do nothing until a rollout restart. The same create-time rule applies on the Pod Identity side, as later sections show.
3. EKS Pod Identity vs IRSA: how the agent and association flow works
EKS Pod Identity vs IRSA diverges at the node: Pod Identity puts an agent DaemonSet on each Linux EC2 node and an association object in the EKS API. The SDK asks the local agent for credentials, the agent asks EKS Auth, and EKS Auth assumes the associated role for that service account.
The association is the mapping. It binds one cluster, one namespace, and one service account to one IAM role, and it lives entirely in the EKS API. There is no annotation on the service account and no Kubernetes object in the cluster describing it. You can even create an association for a namespace or service account that does not exist yet, which makes it friendly to infrastructure-as-code ordering. Each service account in a cluster maps to exactly one role from the cluster's account, and a cluster supports up to 5,000 associations. Associations are eventually consistent, so a fresh association can take several seconds to become effective; do not create them in a hot path and expect instant credentials.
The agent is the delivery mechanism. The eks-pod-identity-agent add-on runs as a DaemonSet with host networking, listening on the link-local addresses 169.254.170.23 for IPv4 and fd00:ec2::23 for IPv6, on ports 80 and 2703. It serves only pods on its own node. When a pod uses an associated service account, EKS injects AWSCONTAINERCREDENTIALSFULLURI and AWSCONTAINERAUTHORIZATIONTOKENFILE into its containers, pointing the SDK's container credential provider at the agent. The agent presents the pod's token to the EKS Auth service, which validates it, looks up the association, and assumes the role. The node role needs the eks-auth:AssumeRoleForPodIdentity permission for this call, which the standard worker node policy already includes. EKS Auto Mode has this capability built in, so the separate agent add-on step does not apply there.
Two operational details bite people. First, proxies: if your pods route traffic through an HTTP proxy, add 169.254.170.23 and fd00:ec2::23 to NO_PROXY, or credential requests to the agent will be sent to the proxy and fail. Second, coverage: the agent is a DaemonSet, so any node it cannot schedule on, because of a taint it does not tolerate or a node group added later, is a node where Pod Identity silently does not work. Per-node symptoms are the tell, and section 9 returns to it.
4. IAM trust in EKS Pod Identity vs IRSA: OIDC subject versus service principal
EKS Pod Identity vs IRSA trust policies look nothing alike. An IRSA role trusts a specific cluster OIDC provider and pins the exact service-account subject and audience. A Pod Identity role trusts the pods.eks.amazonaws.com service principal with AssumeRole and TagSession, identical across clusters and accounts.
sts:AssumeRoleWithWebIdentity, and the conditions pin two claims: aud must equal sts.amazonaws.com, and sub must equal the exact system:serviceaccount:<namespace>:<name> string. Use StringEquals for both. The common shortcut, StringLike with a wildcard such as system:serviceaccount:payments:*, quietly lets every service account in the namespace assume the role, including ones created later by other teams. That single condition is the difference between a scoped workload identity and a namespace-wide credential.
The Pod Identity trust policy is deliberately boring. The principal is the EKS service, the actions are sts:AssumeRole and sts:TagSession, and there is no cluster reference at all. The same role can be associated in every cluster without touching the trust policy, which is the reuse win. TagSession exists because EKS attaches session tags identifying the cluster, namespace, service account, and pod to each session. You can use those tags in condition keys to restrict which clusters or namespaces may use a shared role, which recovers most of the scoping power the IRSA sub condition gave you, but only if you actually write those conditions. A Pod Identity role with no conditions trusts any association in any cluster that can reference it, so the association API becomes the control point.
The governance consequence follows. Under IRSA, anyone who can edit a service account annotation can point a workload at a role, and the trust policy decides whether STS honors it. Under Pod Identity, changing a workload's role requires IAM permission to create or update an EKS association, plus iam:PassRole on the role, and the change lands in CloudTrail as an EKS API call. Kubernetes RBAC alone cannot repoint a workload at a different AWS role. For platform teams separating cluster administration from IAM administration, that is a real control improvement, not a cosmetic one. The Kubernetes RBAC least-privilege guide covers the Kubernetes side of that split.
5. Credential chain and precedence in EKS Pod Identity vs IRSA
EKS Pod Identity vs IRSA failures often hide in the SDK credential chain, not in IAM. Static environment credentials and web-identity credentials are resolved before the container credential provider, so a leftover IRSA annotation or injected key silently wins over a correct Pod Identity association.
AWS SDKs resolve credentials in a fixed order: explicit configuration and static environment variables first, then web identity, then the container credential provider, then instance metadata. Both EKS mechanisms plug into this chain rather than replacing it. IRSA wins through AWSROLEARN and AWSWEBIDENTITYTOKENFILE. Pod Identity wins through AWSCONTAINERCREDENTIALSFULLURI and AWSCONTAINERAUTHORIZATIONTOKENFILE. If both sets of variables are present in a pod, the SDK takes the web-identity path first, which means a half-finished migration keeps using IRSA even though the association exists and looks correct in the console. This is the single most confusing state in this topic: every control-plane check passes, and the pod still uses the old identity.
The last step of the chain is the dangerous one. If no earlier provider yields credentials, most SDKs fall through to the EC2 instance metadata service and pick up the node role. The application does not crash. It runs with the wrong identity, and you find out either from an AccessDenied naming the node role or, worse, from a successful call that should never have been permitted. Two defenses matter. First, restrict IMDS access from pods, for example with a metadata hop limit of 1, so the fallback fails loudly instead of silently succeeding. Note that pods with hostNetwork: true always retain IMDS access, though SDKs still prefer Pod Identity credentials when they are injected. Second, verify identity from inside the pod with aws sts get-caller-identity during every migration and every incident, because the returned ARN settles arguments that configuration review cannot.
SDK version is the third chain trap. The container credential provider that Pod Identity relies on requires a reasonably current SDK. A service built years ago on an old SDK can ignore the injected variables entirely, fall through to IMDS, and fail with a metadata 404 once the hop limit blocks it. When a workload works under IRSA and breaks under Pod Identity with no credential error pointing at EKS, check the SDK version before touching IAM. Application code does not change between the two mechanisms, but the SDK must know how to read the provider each one injects.
6. Setup walkthrough for EKS Pod Identity vs IRSA
Setting up EKS Pod Identity vs IRSA means wiring the same three pieces in different places: an IAM role with the right trust policy, a mapping from service account to role, and a pod restart so injection happens. IRSA puts the mapping in an annotation; Pod Identity puts it in an EKS association.
For IRSA, the sequence is: register the cluster OIDC provider in IAM once, create the role with the pinned trust policy from section 4, attach the permission policy, then annotate the service account. The annotation is the only in-cluster artifact.
For Pod Identity, the sequence is: install the agent add-on once per cluster (skip this on EKS Auto Mode), create the role with the pods.eks.amazonaws.com trust policy, attach the permission policy, then create the association. The service account stays plain, with no annotation.
Whichever path you took, finish the same way: restart the workload so new pods get the injected variables, then prove the identity from inside a pod before calling the setup done.
The environment check tells you which mechanism the pod actually received: AWSROLEARN means IRSA, AWSCONTAINERCREDENTIALSFULLURI means Pod Identity, and neither means the pod predates the mapping or uses the wrong service account. The caller-identity ARN must name the workload role. If it names the node role, stop and fix the chain before testing application calls, because application tests can pass for the wrong reason. Workloads that consume AWS identity indirectly, such as the External Secrets Operator setup, need the same proof at their own service account.
7. Migrating in EKS Pod Identity vs IRSA without breaking pods
Migrating EKS Pod Identity vs IRSA safely means running both trust paths at once, then cutting over workload by workload. Add the Pod Identity statement to the existing role trust policy, create the association, restart, verify the caller identity, and only then remove the IRSA annotation.
The dual-trust step is what makes the migration boring. A role trust policy can carry both statements at the same time: the federated OIDC statement for IRSA and the service-principal statement for Pod Identity. Old pods keep working through IRSA while new pods, once the annotation is gone, come up on Pod Identity. There is no flag day and no window where the workload has no credentials, as long as you sequence the steps correctly.
Order matters in two places. Create the association before removing the annotation; reversing that leaves a window where new pods get neither mechanism and fall back to the node role. And remove the annotation before the restart; restarting first just re-injects the IRSA variables, and the credential chain keeps preferring web identity over the container provider, so the migration appears complete while nothing changed. Helm charts make this worse: many charts template the role-arn annotation from values, so a manual kubectl annotate removal gets reverted on the next chart upgrade. Change the chart values, not just the live object, and grep your values files for role-arn before declaring a workload migrated.
Verify empirically, per workload, and keep the old trust statement for at least one full deploy cycle after the cutover. CloudTrail is the ground truth: check that new sessions for the workload arrive through the Pod Identity path and that the caller ARN is the workload role, not the node role. Only after that evidence exists should you drop the OIDC statement from the trust policy. Dropping it early is the classic self-inflicted outage: a forgotten CronJob or a long-running pod that never restarted loses its credentials mid-flight. Inventory every service account with an IRSA annotation first, including the ones owned by operators and add-ons, and migrate from that list rather than from memory.
8. Troubleshooting AccessDenied in EKS Pod Identity vs IRSA
AccessDenied in EKS Pod Identity vs IRSA splits into two different bugs wearing one error. Either the pod assumed the right role and the role lacks the permission, or the pod never assumed the role at all. Read the caller ARN in the error first; it tells you which bug you have.
Start with identity, not policy. Run aws sts get-caller-identity from inside the pod, or read the principal named in the CloudTrail event for the denied call. Three outcomes cover nearly every case. The ARN names your workload role: the identity path works, and the problem is a missing permission, a resource policy, a permissions boundary, or a KMS key policy on the target resource. The ARN names the node role: the pod fell back to IMDS, and the identity path is broken upstream of IAM permissions. The call fails during credential retrieval with an STS error: the trust policy rejected the exchange, which is an IRSA-side or trust-side problem, not a permissions problem.
AWSROLEARN and AWSWEBIDENTITYTOKENFILE; missing variables mean the pod predates the annotation or uses a different service account than the one you annotated, and the fix is a restart after correcting the service account. Confirm the OIDC provider for this cluster exists in the role's account; a rebuilt cluster has a new issuer ID, and trust policies copied from the old cluster point at a dead issuer, producing the InvalidIdentityToken error. Then compare the trust policy sub condition character by character against system:serviceaccount:<namespace>:<name> for the pod's real service account. A namespace typo fails silently: the pod starts, Kubernetes reports nothing wrong, and the first AWS call returns AccessDenied.
For Pod Identity rejections, the checks move to the EKS side. List the associations for the cluster and confirm one exists for the exact namespace and service account the pod uses; a service account renamed by a Helm chart is a common mismatch. Confirm the role trust policy contains the pods.eks.amazonaws.com statement with both sts:AssumeRole and sts:TagSession; missing TagSession breaks session creation. Confirm the agent pods are Running on the node the failing pod landed on. And confirm the pod started after the association was created, allowing a few seconds for eventual consistency; a pod created in the same minute as the association can legitimately miss it. The EKS vs GKE vs AKS production comparison is a useful reminder that this whole failure class is EKS-specific plumbing, not Kubernetes behavior.
One AccessDenied variant deserves its own warning: the error names the correct role, the policy clearly allows the action, and the call still fails. Look beyond the identity policy. A permissions boundary on the role, an SCP on the account, a resource policy on the bucket or key, or a VPC endpoint policy can each deny independently. Session tags add one more: if you wrote tag-based conditions into the trust or permission policies, a missing or unexpected tag value denies the call. Use the IAM policy simulator or CloudTrail's error detail to find which layer said no instead of widening the identity policy on a guess.
9. Troubleshooting no credentials in EKS Pod Identity vs IRSA
No-credentials errors in EKS Pod Identity vs IRSA mean the SDK found nothing usable in the chain: no injected variables, an unreachable agent endpoint, or an SDK too old to read the provider. Check the pod environment first, then the agent on that node, then the SDK version.
The fastest split is the environment check from section 6. If neither AWSROLEARN nor AWSCONTAINERCREDENTIALSFULLURI is present, the pod was created before the mapping existed or it uses the wrong service account. Both mechanisms inject at pod creation only, so the fix is correcting the service account and restarting, not editing IAM. Also check for AWSACCESSKEY_ID in the environment: static keys injected from a Secret take precedence over everything and can mask a working identity path with an expired or wrong key. Grep the pod spec and its env sources, because keys usually arrive through a secretRef nobody remembers adding.
If AWSCONTAINERCREDENTIALSFULLURI is present but credential retrieval fails with a connection error to 169.254.170.23, the agent is not reachable from that pod. Check whether an agent pod runs on the same node; a node group with a taint the DaemonSet does not tolerate is the usual cause, and it produces the maddening pattern where the same Deployment works on some replicas and fails on others. Check NO_PROXY next: a proxy variable that does not exclude the link-local agent address sends credential requests to the proxy, which cannot answer them. Then read the agent logs on that node for association or EKS Auth errors.
If the variables are present, the agent is reachable, and the SDK still reports no credentials or falls through to a metadata 404, suspect the SDK. Pod Identity depends on the container credential provider in the SDK's default chain; old SDK builds predate it and ignore the injected endpoint. IRSA has the mirror-image problem with very old SDKs and the web-identity provider. The fix is an SDK upgrade in the image, and the diagnostic is simple: a current AWS CLI in a debug container on the same service account succeeds while the application fails. That result clears EKS, IAM, and the agent in one step and points at the application image. Keep a small debug pod manifest with the workload's service account for exactly this test, and delete it after the incident.
Fargate and Windows deserve a direct note here, because no-credentials errors on those nodes are not a bug. Pod Identity is not available for Fargate pods or Windows nodes; the agent model requires Linux EC2 worker nodes. A workload that lands on Fargate with only a Pod Identity association will never receive credentials. Those workloads must use IRSA, which works on Fargate, or move to Linux EC2 nodes. Mixed clusters therefore run both mechanisms side by side permanently, and your runbooks should say which namespaces use which, so the next engineer does not debug the wrong chain.
10. Security boundaries in EKS Pod Identity vs IRSA
EKS Pod Identity vs IRSA both scope credentials to a service account, and neither makes containers a security boundary. The real boundaries are the trust conditions, IMDS restriction, and who can change the mapping. Treat node-role fallback as a vulnerability, not a convenience.
Start with what both mechanisms do not do. Pods on the same node share a kernel, and node-level components such as kubelet and CSI drivers hold privileges beyond any single pod. A compromised container with host access, a privileged pod, or a node compromise can reach credentials that per-workload scoping was supposed to isolate. Pod Identity and IRSA limit the blast radius of a normal application compromise; they do not replace Pod Security Standards, seccomp, read-only filesystems, or node hardening. The SecurityContext and Pod Security Standards guide covers that layer, and the NetworkPolicy troubleshooting guide covers the network layer beside it.
The credential-isolation boundary depends on IMDS. When IMDS access from pods is restricted, a container can retrieve only the credentials for its own service account's role. When IMDS is open, containers can also reach the node role credentials, and potentially credentials belonging to other pods' roles on the same node. That turns your carefully scoped per-workload roles into decoration, because any pod can bypass them through the metadata service. Set the metadata hop limit to 1 on node groups, or block pod access to IMDS with network policy or node configuration, and audit for hostNetwork: true pods, which always retain IMDS access even though SDKs prefer injected credentials.
The mapping boundary is where the two mechanisms genuinely differ. Under IRSA, the trust policy sub condition is the guardrail: pin it with StringEquals to one service account, and review any wildcard as a security finding. The annotation side is softer, because anyone with permission to edit the service account can point it at a role, leaving the trust policy as the only check. Under Pod Identity, the association is an EKS API object: creating or changing it requires IAM permissions including iam:PassRole, and every change is a CloudTrail event. That gives security teams a single auditable control point, but it also concentrates risk: a principal who can create associations and pass roles can grant any workload any role, so those permissions belong in a short, reviewed list.
Shared roles need explicit scoping under Pod Identity. Because the trust policy names no cluster, one role can serve the same service account across many clusters, which is the reuse benefit. Use the session tags EKS attaches, such as namespace, service account, and cluster identifiers, in policy conditions to keep a shared role honest, and prefer separate roles where blast radius matters more than reuse. Under IRSA the equivalent discipline is one trust statement per cluster with exact subject pins, accepting the policy sprawl as the price of precision. Either way, review the effective permission set, not the mechanism: a scoped identity carrying an administrator policy is still an administrator.
11. When to choose each in EKS Pod Identity vs IRSA
Choose EKS Pod Identity vs IRSA by platform fit first and team shape second. Pod Identity suits Linux EC2 node fleets, many clusters, and teams that want IAM-governed mappings. IRSA remains required for Fargate, Windows nodes, and anywhere the Pod Identity agent cannot run.
Pod Identity earns its place at fleet scale. The per-cluster OIDC provider and per-role trust-policy edits that IRSA requires grow linearly with cluster count, and every cluster rebuild changes issuer IDs under existing trust policies. Pod Identity removes the cluster from the trust policy entirely: one role, one trust shape, associations per cluster created through the EKS API. If you run many clusters across accounts, share platform roles such as external-secrets or load-balancer-controller roles across them, or split cluster administration from IAM administration between teams, Pod Identity removes real toil and a real class of copy-paste trust-policy errors. EKS Auto Mode clusters should default to it, since the capability is built in.
IRSA remains the right answer in several concrete cases. Fargate pods cannot use Pod Identity, full stop; the Fargate Pod execution role is for EKS infrastructure, and containers on Fargate get AWS permissions through IRSA. Windows nodes are likewise unsupported. Clusters outside the Pod Identity availability envelope, including EKS Anywhere and self-managed Kubernetes on EC2, cannot use it either, though IRSA in its EKS form also assumes EKS; self-managed clusters need their own OIDC federation design. If your estate is one or two stable clusters with working IRSA and no migration pain, the honest answer is that migrating buys little; IRSA is not deprecated, and churn has its own risk. Migrate when the OIDC and trust-policy maintenance actually hurts, not because the newer mechanism exists.
Mixed operation is normal and supported. Both mechanisms can run in one cluster at the same time, which is how Fargate-plus-EC2 clusters and gradual migrations work. The cost of mixing is cognitive: two credential chains to debug, two mapping inventories to audit, and the precedence trap from section 5 when a pod accidentally carries both. Contain that cost with conventions. Record the mechanism per namespace in your platform documentation, keep the service-account-to-role inventory in one generated report rather than in tribal memory, and make aws sts get-caller-identity from a debug pod the first step in every AWS-permission incident runbook. A team that can answer "which identity does this pod hold right now" in thirty seconds will find either mechanism manageable.
A short decision pass covers most estates. New Linux EC2 clusters and Auto Mode: Pod Identity. Existing IRSA estates with multi-cluster trust-policy pain: migrate workload by workload with dual trust. Fargate, Windows, or non-EKS: IRSA or the platform equivalent. Single stable cluster with no pain: leave it alone and spend the effort on least-privilege review instead. The mechanism matters less than the discipline around it: exact trust conditions, restricted IMDS, verified caller identity, and roles scoped to what the workload actually calls.
12. EKS Pod Identity vs IRSA comparison matrix and final checklist
EKS Pod Identity vs IRSA reduces to a short matrix: IRSA federates through a per-cluster OIDC provider and an annotation, Pod Identity through a service principal, an EKS association, and a node agent. Match the symptom to the chain layer before editing IAM.
| Dimension | IRSA | EKS Pod Identity |
|---|---|---|
| Trust anchor | Per-cluster IAM OIDC provider | pods.eks.amazonaws.com service principal |
| Mapping lives in | Service-account annotation plus trust policy | EKS API association object |
| Credential path | Pod token to STS AssumeRoleWithWebIdentity |
SDK to node agent to EKS Auth to STS |
| Injected variables | AWSROLEARN, AWSWEBIDENTITYTOKENFILE |
AWSCONTAINERCREDENTIALSFULLURI, AWSCONTAINERAUTHORIZATIONTOKENFILE |
| Node component | None beyond kubelet token projection | Agent DaemonSet on Linux EC2 nodes |
| Role reuse across clusters | Trust policy must name each cluster provider | Same role and trust policy everywhere |
| Fargate and Windows | Supported | Not supported |
| Who can change the mapping | Service-account editors, checked by trust policy | IAM principals with EKS association and PassRole permissions |
| Audit trail | STS events, annotation changes in cluster audit | EKS API events in CloudTrail plus STS events |
| Scaling limit | OIDC providers and trust statements per cluster | 5,000 associations per cluster |
The troubleshooting matrix routes incidents by symptom:
| Symptom | Likely layer | First check | Fix |
|---|---|---|---|
| AccessDenied naming the node role | Credential fallback to IMDS | aws sts get-caller-identity in the pod |
Restore injection, restart pod, restrict IMDS |
| AccessDenied naming the workload role | Permission, boundary, or resource policy | CloudTrail event and policy layers | Fix the denying layer, not the identity path |
| InvalidIdentityToken, no OIDC provider | IRSA provider registration | aws iam list-open-id-connect-providers |
Register the current cluster issuer |
| AssumeRoleWithWebIdentity not authorized | IRSA trust sub or aud |
Trust policy versus real service account | Pin exact StringEquals values |
| No credentials, no AWS variables in pod | Injection timing or wrong service account | Pod env and serviceAccountName |
Correct the mapping, restart the pod |
| Container credentials endpoint unreachable | Agent missing or proxy | Agent pods per node, NO_PROXY |
Fix DaemonSet scheduling or proxy exclusions |
| Works on some replicas only | Per-node agent coverage | Agent -o wide against pod nodes |
Remove taint mismatch, retest per node |
| Migration done but IRSA still used | Credential-chain precedence | Env for both variable sets | Remove the annotation in chart values, restart |
| Pod Identity fails on Fargate | Platform support | Node type for the pod | Use IRSA for Fargate workloads |
Final checklist before closing an EKS identity change or incident:
- Caller identity verified from inside the pod, naming the workload role rather than the node role.
- Pod environment shows exactly one mechanism's variables, with no static keys masking the chain.
- IRSA trust policies pin
audandsubwithStringEquals; no namespace wildcards. - Pod Identity associations listed per cluster and matched to live namespaces and service accounts.
- Agent DaemonSet healthy on every Linux EC2 node the workload can schedule onto;
NO_PROXYexcludes the agent addresses. - IMDS restricted from pods, with
hostNetworkpods inventoried as the exception. - Migration left dual trust in place for one deploy cycle, with CloudTrail evidence before the OIDC statement was removed.
- Chart values and infrastructure code updated, so the next deploy does not restore the old annotation.
- Fargate and Windows workloads confirmed on IRSA, with the mechanism recorded per namespace.
- Roles reviewed for least privilege after the change, since a correct identity path with an oversized policy is still a finding.
Run the identity proof first and the permission debate second. Most EKS credential incidents end at the caller-identity output: it names the wrong role, and the matrix above routes you to the layer that produced it. Keep that habit and both mechanisms stay debuggable under pressure.
Frequently Asked Questions
What is EKS Pod Identity vs IRSA in one sentence?
EKS Pod Identity vs IRSA is a choice between two ways to give a pod an IAM role: IRSA has the pod exchange a cluster-signed OIDC token with STS directly, while Pod Identity routes the request through a node-local agent and the EKS Auth service using an association stored in the EKS API.
In EKS Pod Identity vs IRSA, which one should new clusters use?
For new clusters on Linux EC2 nodes or EKS Auto Mode, EKS Pod Identity is usually the simpler default: one trust-policy shape, no per-cluster OIDC provider to register, and mappings governed through IAM. Keep IRSA for Fargate, Windows nodes, and estates where working IRSA causes no real maintenance pain.
Why does my pod use the node role in EKS Pod Identity vs IRSA setups?
The pod fell back to instance metadata because no earlier credential provider succeeded. Usual causes are a pod created before the annotation or association existed, the wrong service account on the pod, a missing agent on that node, or static keys masking the chain. Check the pod environment and caller identity first.
How do I migrate EKS Pod Identity vs IRSA without downtime?
Add the pods.eks.amazonaws.com statement to the role trust policy while keeping the OIDC statement, create the Pod Identity association, remove the IRSA annotation in your chart values, restart the workload, and verify the caller identity in CloudTrail. Drop the OIDC statement only after one clean deploy cycle.
In EKS Pod Identity vs IRSA, what causes AssumeRoleWithWebIdentity AccessDenied?
STS rejected the token exchange, most often because the trust policy sub condition does not exactly match system:serviceaccount:<namespace>:<name> for the pod's real service account, the audience is wrong, or the cluster OIDC provider is not registered in the role's account. Compare the trust policy against the live pod, character by character.
Does EKS Pod Identity work on Fargate or Windows nodes?
No. EKS Pod Identity requires the agent on Linux EC2 worker nodes, so Fargate pods and Windows nodes are not supported. Fargate workloads must use IRSA for AWS permissions. Mixed clusters commonly run Pod Identity on EC2 node groups and IRSA on Fargate profiles at the same time.
How do I check which identity a pod is using?
Run aws sts get-caller-identity from inside the pod or a debug pod with the same service account. The returned ARN names the assumed role. Also inspect the environment: AWSROLEARN indicates IRSA, AWSCONTAINERCREDENTIALSFULLURI indicates Pod Identity, and neither means the pod predates the mapping.