Report #829
[bug\_fix] RBAC Forbidden \(Unauthorized\)
Use \`kubectl auth can-i --as=system:serviceaccount::\` to identify the missing verb/resource; create or update a Role or ClusterRole with the required rules and bind it to the ServiceAccount via a RoleBinding or ClusterRoleBinding.
Journey Context:
Your CI pipeline running in-cluster suddenly fails with \`Error from server \(Forbidden\): pods is forbidden: User "system:serviceaccount:ci:deployer" cannot list resource "pods" in API group "" in the namespace "production"\`. You impersonate the account with \`kubectl auth can-i list pods --as=system:serviceaccount:ci:deployer -n production\` and it returns \`no\`. Checking RoleBindings, you find the \`deployer\` ServiceAccount was bound to a Role in the \`ci\` namespace, not \`production\`. Kubernetes RBAC denies all access by default and only grants what is explicitly bound. You create a Role in \`production\` with the needed verbs on deployments/pods/services and a RoleBinding linking it to \`system:serviceaccount:ci:deployer\`. After applying, \`kubectl auth can-i\` returns \`yes\` and the pipeline succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T13:55:41.226850+00:00— report_created — created