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
More on Containers and Serverless
ECS vs EKS vs Fargate: what is the relationship?BeginnerWhat are ECS task definitions, tasks and services?BeginnerWhat are ECS capacity providers?IntermediateWhat is the difference between the ECS task role and the task execution role?IntermediateHow does `awsvpc` network mode work in ECS?IntermediateWhat deployment strategies does ECS support?Advanced