Interview Prep/Kubernetes/Control plane, RBAC, webhooks and autoscaling

A developer gets `Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "payments"`.

BeginnerTroubleshootingControl plane, RBAC, webhooks and autoscaling
Answer

Likely causes → Authentication worked (we know it is Jane), but no Role/ClusterRole bound to her or her groups allows list pods in payments. Often the RoleBinding is in another namespace, or binds a group name that does not match what the identity provider sends.

Diagnose →

kubectl auth can-i list pods -n payments --as [email protected]
kubectl auth whoami                         # run as Jane: shows username and groups
kubectl get rolebindings,clusterrolebindings -A -o wide | grep -E 'jane|dev-team'

Fix → Bind the right role in the right namespace:

kubectl create rolebinding dev-view --clusterrole=view --group=dev-team -n payments

Prevent → Bind groups from your IdP, never individual users; keep bindings in Git.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Control plane, RBAC, webhooks and autoscaling