Interview Prep/DevSecOps/Cloud identity: IRSA, Workload Identity and CI OIDC

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.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Cloud identity: IRSA, Workload Identity and CI OIDC