Pod stuck in `Init:0/1`; the `vault-agent-init` container logs `error authenticating: ... Code: 403 ... * permission denied`
IntermediateTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer
Likely causes → The Kubernetes auth role does not match the pod: wrong bound_service_account_names, wrong bound_service_account_namespaces, a wrong vault.hashicorp.com/role annotation, or a role that has no policy attached.
Diagnose →
kubectl get pod <pod> -o jsonpath='{.spec.serviceAccountName}{"\n"}{.metadata.annotations}'
vault read auth/kubernetes/role/api
Fix →
vault write auth/kubernetes/role/api \
bound_service_account_names=api \
bound_service_account_namespaces=prod \
policies=api-read ttl=1h
Prevent → Manage roles in Terraform next to the Deployment's ServiceAccount, and give each workload its own SA. Never use default.
More on Secrets management: Vault, External Secrets and SOPS
`vault kv get secret/app/db` returns `Code: 403. Errors: * permission denied` although the policy allows `secret/app/*`BeginnerVault pod restarted and `vault status` shows `Sealed: true`; every app now fails to fetch secretsBeginnerAfter a cluster upgrade, Vault Kubernetes auth fails for every pod with `error validating token: invalid issuer (iss) claim`AdvancedPods annotated with `vault.hashicorp.com/agent-inject: true` start without a Vault sidecar, and the app fails on a missing fileBeginnerExternalSecret shows `SecretSyncedError` with `AccessDeniedException: ... is not authorized to perform: secretsmanager:GetSecretValue`IntermediateExternalSecret reports `could not get provider client: SecretStore "aws-sm" is not ready` or `SecretStore.external-secrets.io "aws-sm" not found`Beginner