After switching an EKS cluster to `authenticationMode: API`, the CI role gets `error: You must be logged in to the server (Unauthorized)`
IntermediateTroubleshootingCloud identity: IRSA, Workload Identity and CI OIDC
Answer
Likely causes → The CI role was only mapped in the aws-auth ConfigMap, which is ignored in API mode. It needs an access entry.
Diagnose →
aws eks describe-cluster --name prod --query cluster.accessConfig
aws eks list-access-entries --cluster-name prod
Fix →
aws eks create-access-entry --cluster-name prod --principal-arn arn:aws:iam::111122223333:role/gha-deploy
aws eks associate-access-policy --cluster-name prod --principal-arn arn:aws:iam::111122223333:role/gha-deploy \
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy \
--access-scope type=namespace,namespaces=prod
Prevent → Migrate through API_AND_CONFIG_MAP, create the entries, verify, and only then switch to API.
More on Cloud identity: IRSA, Workload Identity and CI OIDC
A pod configured for IRSA runs `aws sts get-caller-identity` and gets the node role (`eks-node-group-role`) instead of its own roleBeginner`An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Not authorized to perform sts:AssumeRoleWithWebIdentity` from an IRSA podIntermediate`InvalidIdentityToken: No OpenIDConnect provider found in your account for https://oidc.eks.ap-south-1.amazonaws.com/id/ABC123`BeginnerIRSA env vars are present in the pod, but one legacy service still uses the node roleIntermediatePods without IRSA can still call AWS with the node's permissions through `169.254.169.254`IntermediateWith EKS Pod Identity, the pod gets `Unable to locate credentials` even though a pod identity association existsIntermediate