Interview Prep/Real-World Interview/Cloud provider issues

After someone cleaned up IAM, `kubectl` returns "error: You must be logged in to the server (Unauthorized)" for the whole team, and new EKS nodes can't join.

IntermediateTroubleshootingCloud provider issues
Answer

Likely causes → Mappings from IAM to Kubernetes were removed: entries in the aws-auth ConfigMap (for nodes and users) were overwritten, or EKS access entries were deleted, or the IAM role names in the mapping changed. Nodes whose role isn't mapped can't register.

Diagnose →

aws sts get-caller-identity
aws eks list-access-entries --cluster-name prod
aws eks describe-cluster --name prod --query 'cluster.accessConfig'
kubectl -n kube-system get cm aws-auth -o yaml   # from a principal that still has access

Fix → The IAM principal that created the cluster (or any access entry with cluster admin) can restore access. Re-create the access entries for the node role (type EC2_LINUX) and for the admin roles with AmazonEKSClusterAdminPolicy:

aws eks create-access-entry --cluster-name prod --principal-arn $NODE_ROLE_ARN --type EC2_LINUX
aws eks create-access-entry --cluster-name prod --principal-arn $ADMIN_ROLE_ARN
aws eks associate-access-policy --cluster-name prod --principal-arn $ADMIN_ROLE_ARN \
  --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy --access-scope type=cluster

Prevent → Manage access entries in Terraform (move off aws-auth), keep a documented break-glass admin role, and never hand-edit the ConfigMap in production.

All Real-World Interview questions Roadmap: Interview readiness

More on Cloud provider issues