Kubernetes Forbidden: diagnose RBAC for the exact denied operation
Error from server (Forbidden)
A Kubernetes Forbidden response means the API request was rejected by an authorization or admission decision. When the message says a user cannot perform a verb on a resource, inspect that identity's RBAC and request scope. Not every HTTP 403 is an RBAC problem: quota and admission failures need their own specific diagnosis.
The active kubeconfig context or workload ServiceAccount is not the identity expected to have the requested permission.
A RoleBinding applies in another namespace, references the wrong subject, or points to a role that does not include the required operation.
The rule covers the wrong API group, resource, subresource, or verb; permission to get an object does not automatically include list, watch, or logs.
The client makes a cluster-wide request even though its permissions are namespaced, or a separate admission policy denies an otherwise authorized operation.
How to fix it
Read the full server message and record the user, verb, resource, API group, and namespace or cluster scope. Confirm kubectl config current-context before changing access. If the error names a quota, webhook, or policy instead of a missing permission, investigate that component first.
Test the precise operation with kubectl auth can-i, for example kubectl auth can-i list pods -n NAMESPACE or kubectl auth can-i get deployments.apps -n NAMESPACE. For logs, test the log subresource. Avoid treating a successful test for one verb as proof that all related requests are allowed.
For an in-cluster client, inspect the Pod's spec.serviceAccountName and namespace. An administrator can test that identity using --as=system:serviceaccount:NAMESPACE:ACCOUNT only if they have impersonation permission. A failed impersonation test is not evidence that the target account itself lacks the requested resource access.
Have an authorized administrator compare the relevant Role or ClusterRole with its bindings. A RoleBinding grants access in its own namespace even when it references a ClusterRole. Match subject names exactly and distinguish core resources with API group "" from resources such as deployments in apps.
Apply the smallest approved permission change, or narrow a client that unnecessarily requests all namespaces. Do not grant cluster-admin or wildcard permissions as a troubleshooting shortcut. Retest the exact original operation and confirm unrelated resources remain restricted; a successful authorization check does not override admission policies.