Interview Prep/Kubernetes/Security, RBAC and policy

A developer needs read-only access to one namespace. How do you grant it?

BeginnerScenarioSecurity, RBAC and policy
Answer

Situation read → A new joiner should view pods and logs in staging only.

What I'd do →

  1. Use the built-in view ClusterRole bound with a RoleBinding: kubectl create rolebinding dev-view --clusterrole=view [email protected] -n staging
  2. Bind groups rather than users when using SSO
  3. Test with kubectl auth can-i list pods -n staging --as [email protected]
  4. Confirm secrets are not readable: can-i get secrets
  5. On EKS map IAM identities with access entries

Why → A RoleBinding scopes a ClusterRole to a single namespace.

Interview tip → Say least privilege and group-based bindings.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy