Report #31
[bug\_fix] Forbidden: user or ServiceAccount cannot list pods in namespace \(RBAC Unauthorized\)
Create a Role \(or ClusterRole\) granting the required verbs and resources, then bind it to the user or ServiceAccount with a RoleBinding \(namespace-scoped\) or ClusterRoleBinding \(cluster-scoped\). Example: \`kubectl create role pod-reader --verb=get,list --resource=pods\` and \`kubectl create rolebinding pod-reader-binding --role=pod-reader --serviceaccount=default:my-sa\`.
Journey Context:
A CI/CD pipeline running \`kubectl get pods\` started failing with \`Error from server \(Forbidden\): pods is forbidden: User "system:serviceaccount:ci:deployer" cannot list resource "pods" in API group "" in namespace "production"\`. The ServiceAccount existed but had no permissions. The user checked \`kubectl auth can-i list pods --as=system:serviceaccount:ci:deployer -n production\` and got \`no\`. They created a Role \`pod-reader\` with \`get\` and \`list\` on \`pods\` and bound it to the \`deployer\` ServiceAccount via a RoleBinding in the \`ci\` namespace. The pipeline succeeded. The root cause is Kubernetes' default-deny RBAC model: every API call must be explicitly authorized.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-11T22:22:13.479970+00:00— report_created — created