Ravindra BagaleCourses & study guides मराठी

Chapter 88: Amazon EKS for DevOps

DevOps

88.6 Access entries and aws-auth

Story. Fatima joined a Deloitte-style delivery team in Hyderabad. Her IAM user could call aws eks describe-cluster but kubectl get pods returned Unauthorized. The cluster never mapped her IAM principal to a Kubernetes group. Older clusters used the aws-auth ConfigMap in kube-system. Newer EKS access management uses access entries in the EKS API. Fatima's platform lead created an access entry for her IAM role with a policy that granted cluster view. Always know which model your cluster uses.

IAM proves who you are. Access entry or aws-auth maps you into Kubernetes RBAC groups.
IAM proves who you are. Access entry or aws-auth maps you into Kubernetes RBAC groups.

Why

AWS IAM and Kubernetes RBAC are two doors. Passing IAM is not enough. The cluster must map your principal to Kubernetes permissions.

What

  • Access entry — Current EKS API object that links an IAM principal to cluster access policies.
  • aws-auth ConfigMap — Older mapping from IAM roles/users to Kubernetes groups (system:masters, etc.).
  • Kubernetes RBAC — Roles and RoleBindings inside the cluster for fine app permissions.
  • Cluster creator — The principal that created the cluster often starts with admin; do not rely on one human forever.

How

  1. Prefer access entries for new clusters when your account supports them.
  2. If you still maintain aws-auth, edit carefully — a bad edit can lock everyone out.
  3. Map humans and CI roles to least-privilege groups, not blanket system:masters.
  4. Test with a second admin role before you remove the first.

Example 1: List access entries (shape)

aws eks list-access-entries --cluster-name shop-lab --region ap-south-1

Output

{
    "accessEntries": [
        "arn:aws:iam::123456789012:role/shop-platform-admin"
    ]
}

What it shows: At least one IAM role is registered as an access entry. Exact ARNs are yours.

Example 2: Legacy aws-auth mapRoles shape (awareness)

apiVersion: v1
kind: ConfigMap
metadata:
  name: aws-auth
  namespace: kube-system
data:
  mapRoles: |
    - rolearn: arn:aws:iam::123456789012:role/shop-node-role
      username: system:node:{{EC2PrivateDNSName}}
      groups:
        - system:bootstrappers
        - system:nodes

What it shows: Node instance roles must be mapped so kubelet can join. Do not delete node mappings. Prefer access entries on new setups when available.

Ravindra Bagale's Tip

Never leave a single human as the only cluster admin. Keep a break-glass IAM role with a tested access entry.

Quick quiz

Q1. What is an access entry?

An EKS API mapping from an IAM principal to cluster access.

Q2. What is aws-auth?

The older ConfigMap that maps IAM roles/users to Kubernetes groups.

Q3. Why can describe-cluster work but kubectl fail?

IAM allows the EKS API call, but the cluster has no mapping or RBAC for that principal.

Did you understand? Let us try it once more.