Report #2047
[bug\_fix] Unauthorized when calling Kubernetes API from in-cluster Pod
Grant RBAC permissions by creating a Role \(or ClusterRole\) with the needed verbs/resources and a RoleBinding \(or ClusterRoleBinding\) to the Pod's ServiceAccount. Do not mount the default ServiceAccount token or use cluster-admin for application pods.
Journey Context:
An application pod calls the Kubernetes API to list pods and receives HTTP 401/403 'Unauthorized'. \`kubectl auth can-i list pods --as=system:serviceaccount:default:default\` returns no. Creating a Role with \`list pods\` and a RoleBinding to the pod's ServiceAccount, then updating the deployment to use that ServiceAccount, allows the API call. The root cause is the default ServiceAccount has no API permissions by default.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T09:51:30.573722+00:00— report_created — created