π EKS Authentication & Authorization β Design Patterns (Interview Level)
First β say this in interview to sound senior:
βIn EKS I separate identity into three planes β human access, workload access, and deployment automation β and design each differently.β
Thatβs a strong opener.
π§© Layer 1 β How EKS Authentication Works (Foundation)
EKS does not use Kubernetes native users. EKS uses AWS IAM for authentication to the control plane.
Flow:
IAM identity β aws-iam-authenticator β Kubernetes RBAC mapping β permission granted
So:
- IAM = authentication
- RBAC = authorization
Interviewers want this sentence.
π€ Pattern 1 β Human User Access to EKS (kubectl access)
β Design Pattern β IAM + aws-auth + RBAC
Flow:
User β AWS SSO/IAM Role β mapped in aws-auth ConfigMap β Kubernetes RBAC role β namespace access
Design:
- No IAM users with keys
- Use AWS SSO / federated login
- Users assume role
- Role mapped to K8s group
- Group bound to RBAC role
β Example Pattern β Team Namespace Access
Platform team role β cluster-admin Team-A role β namespace-a admin Team-B role β namespace-b read/write
This prevents cross-team blast radius.
β Bad Pattern (interview red flag)
- mapping everyone to system:masters
- giving cluster-admin to all engineers
- using static IAM users with access keys
π§βπ» Pattern 2 β CI/CD Deployment to EKS
This is heavily asked.
β Design Pattern β CI Role + Namespace RBAC
CI system (Jenkins/GitHub Actions) assumes dedicated IAM role β mapped in aws-auth β mapped to limited K8s RBAC β deploy only allowed namespaces.
Why:
- no personal creds in pipeline
- auditable
- revocable
- least privilege
β Production Guardrail
Separate roles:
ci-dev-deployer ci-stage-deployer ci-prod-deployer
Each mapped to env namespace only.
π¦ Pattern 3 β Pod β AWS Resource Access (Very Important)
This is NOT kubectl auth β this is runtime auth.
β Best Practice β IRSA (IAM Roles for Service Accounts)
ServiceAccount β IAM Role binding via OIDC.
Pod uses service account β gets IAM role β calls AWS APIs.
Why this is best:
- pod-level least privilege
- no node-role overpermission
- no static keys
- audit trail per workload
β Bad Pattern
Using node instance role for all pods. One pod compromise β full node IAM permissions.
Interviewers expect you to call this out.
π’ Pattern 4 β Multi-Team Cluster Access Model
Senior-level answer:
β Namespace + IAM Role + RBAC Binding Model
Per team:
IAM role per team mapped β k8s group group β namespace rolebinding namespace quotas + network policies enforced
β Add Guardrails
- OPA/Kyverno policies
- resource quotas
- limit ranges
- network policies
- PodSecurity standards
Auth without guardrails is incomplete design.
π Pattern 5 β Fine-Grained Authorization Inside Cluster
β RBAC Levels You Should Mention
ClusterRole β cluster scope Role β namespace scope RoleBinding β attach to subject ClusterRoleBinding β global attach
Best practice β namespace RoleBindings for teams.
π Pattern 6 β External Identity Provider Integration
β OIDC / SSO Integration Pattern
Enterprise fintech pattern:
IdP (Okta/Azure AD) β AWS SSO β IAM roles β EKS RBAC mapping
Benefits:
- central offboarding
- MFA enforced
- audit trail
- no local IAM users
π¦ Pattern 7 β Read-Only Access for Auditors / Support
Create IAM role β mapped to k8s read-only cluster role β view-only access.
Important for fintech audits.
π§ Pattern 8 β Break-Glass Admin Access
Have emergency admin role:
- MFA required
- session logged
- approval workflow
- not used daily
Interview gold answer.
β οΈ Limits & Gotchas Interviewers Like
aws-auth ConfigMap is critical
- misconfig β lockout
- must be version controlled
- GitOps manage it
- backup mapping roles
Token lifetime
kubectl tokens are short-lived (STS). Good for security β may surprise users.
π§± Full Secure EKS Access Architecture (What to Say)
Say this in interview:
Human users authenticate via SSO β assume IAM roles β mapped to RBAC groups. CI/CD uses dedicated deployer roles with namespace-scoped RBAC. Workloads use IRSA for AWS access. Guardrails enforced via policy engine and quotas. No static credentials, no shared admin, and access is namespace-isolated.