Flux Kustomization fails with `decryption failed for 'db-secret': ... failed to get the data key required to decrypt the SOPS file`
IntermediateTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer
Likely causes → spec.decryption is missing from the Kustomization, the referenced secret is in the wrong namespace, or the age key in it is stored under a key name that does not end in .agekey.
Diagnose →
flux get kustomizations -A
kubectl get kustomization apps -n flux-system -o yaml | yq '.spec.decryption'
kubectl get secret sops-age -n flux-system -o jsonpath='{.data}' | jq 'keys'
Fix →
kubectl create secret generic sops-age -n flux-system \
--from-file=age.agekey=./age.agekey
spec:
decryption:
provider: sops
secretRef: { name: sops-age }
Prevent → Bootstrap the decryption secret as part of cluster provisioning, and keep its private key in a cloud secret manager.
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`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`Intermediate