Pods annotated with `vault.hashicorp.com/agent-inject: true` start without a Vault sidecar, and the app fails on a missing file
BeginnerTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer
Likely causes → The injector's mutating webhook is not running or does not select the namespace. Or the annotation sits on the Deployment metadata instead of the pod template. Or the value is not a quoted string. Because the webhook uses failurePolicy: Ignore, the pod is admitted unmutated.
Diagnose →
kubectl get mutatingwebhookconfiguration vault-agent-injector-cfg -o yaml | yq '.webhooks[].namespaceSelector'
kubectl logs -n vault deploy/vault-agent-injector | tail
kubectl get deploy api -o yaml | yq '.spec.template.metadata.annotations'
Fix → Put the annotations under spec.template.metadata.annotations, write "true" with quotes, then roll out the Deployment again. Mutations only happen at pod creation.
Prevent → Add a policy that fails pods carrying the inject annotation but no vault-agent container.
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 secretsBeginnerPod stuck in `Init:0/1`; the `vault-agent-init` container logs `error authenticating: ... Code: 403 ... * permission denied`IntermediateAfter a cluster upgrade, Vault Kubernetes auth fails for every pod with `error validating token: invalid issuer (iss) claim`AdvancedExternalSecret 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