Report #602
[bug\_fix] RBAC Forbidden \(Unauthorized\)
Identify the subject from the error message \(user or ServiceAccount\), the resource, verb, API group, and scope. Create or update a Role \(namespace-scoped\) or ClusterRole \(cluster-scoped\) with the required rules, then bind it to the subject with a RoleBinding or ClusterRoleBinding. Verify with \`kubectl auth can-i --as= \[-n \]\` before retrying the original command.
Journey Context:
A CI pipeline service account tries to deploy a new namespace and gets \`namespaces is forbidden: User "system:serviceaccount:ci:deployer" cannot create resource "namespaces"\`. The ServiceAccount has no permissions because RBAC is deny-by-default. The cluster admin creates a ClusterRole that allows \`create\` on \`namespaces\` and binds it to the ServiceAccount with a ClusterRoleBinding. In another case an operator pod logs \`pods/exec is forbidden\` when trying to run commands in other pods; the fix is a Role in the operator's namespace that grants \`create\` on \`pods/exec\` and a RoleBinding to the operator's ServiceAccount. The error string itself contains the exact verb and resource, so the remediation is a precise grant rather than blindly giving cluster-admin.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T09:58:25.472414+00:00— report_created — created