kubernetes
auth_error
ai_generated
true
Error creating: pods is forbidden: error looking up service account: serviceaccount not found
ID: kubernetes/k8s-service-account-not-found
92%Fix Rate
90%Confidence
55Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
Pod references a ServiceAccount that doesn't exist in the namespace. Pods can't be created until the ServiceAccount is created.
genericWorkarounds
-
95% success Create the missing ServiceAccount in the correct namespace
kubectl create serviceaccount <name> -n <namespace>
Sources: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
-
88% success Verify the pod spec references the correct ServiceAccount name and namespace
kubectl get serviceaccounts -n <namespace> to list available service accounts
Sources: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
Dead Ends
Common approaches that don't work:
-
Remove the serviceAccountName field to use default
65% fail
May break RBAC-dependent workloads that need specific permissions
-
Create the ServiceAccount in a different namespace
90% fail
ServiceAccounts are namespace-scoped — must be in the same namespace as the pod
Error Chain
Leads to:
Preceded by:
Frequently confused with: