Report #1037
[bug\_fix] Unauthorized / RBAC: user or ServiceAccount cannot perform an action on a resource
Reproduce with kubectl auth can-i --as=system:serviceaccount::. If it returns no, create a Role or ClusterRole with the required verbs and resources, then bind it to the user or ServiceAccount with a RoleBinding or ClusterRoleBinding. Check API server audit logs for the exact resource, subresource, and API group being denied.
Journey Context:
A CI pipeline fails with error: You must be logged in to the server. You verify the kubeconfig uses a ServiceAccount token, but the next run fails with pods is forbidden: User system:serviceaccount:ci:deployer cannot create resource pods in API group ''. You run kubectl auth can-i create pods --as=system:serviceaccount:ci:deployer and it says no. The Role attached to deployer only allows create deployments. You add pods and services to the Role, apply it, and the pipeline succeeds. The fix works because Kubernetes RBAC is deny-by-default; every API call is checked against the aggregated rules of all RoleBindings and ClusterRoleBindings attached to the identity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T16:54:43.818578+00:00— report_created — created