Interview Prep/AWS/Containers and Serverless

How do you grant IAM principals access to an EKS cluster?

IntermediateConceptContainers and Serverless
Answer

Newer clusters use access entries (API authentication mode): you map an IAM principal to Kubernetes permissions via access policies like AmazonEKSClusterAdminPolicy or to RBAC groups. The older method is the aws-auth ConfigMap in kube-system, which is error-prone and can lock you out if corrupted.

aws eks create-access-entry --cluster-name prod --principal-arn arn:aws:iam::123456789012:role/dev
aws eks associate-access-policy --cluster-name prod --principal-arn $ARN \
  --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSViewPolicy \
  --access-scope type=namespace,namespaces=app
aws All AWS questions Roadmap: EKS, ECS & serverless on AWS

More on Containers and Serverless