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.
More on Control plane, RBAC, webhooks and autoscaling
A CI pipeline fails with `deployments.apps "api" is forbidden: User "system:serviceaccount:ci:deployer" cannot patch resource "deployments" in API group "apps" in the namespace "prod"`.BeginnerA user can `get pods` but `kubectl logs` fails with `cannot get resource "pods/log"` and `kubectl exec` fails with `cannot create resource "pods/exec"`.BeginnerCreating a RoleBinding fails with `is attempting to grant RBAC permissions not currently held`.IntermediateEvery `kubectl apply` fails with `Internal error occurred: failed calling webhook "validate.kyverno.svc-fail": failed to call webhook: Post "https://kyverno-svc.kyverno.svc:443/validate/fail?timeout=10s": context deadline exceeded`.AdvancedCreating a Certificate fails with `failed calling webhook "webhook.cert-manager.io": ... no endpoints available for service "cert-manager-webhook"`.IntermediateA webhook fails with `failed calling webhook ... tls: failed to verify certificate: x509: certificate signed by unknown authority`.Intermediate