After switching to encrypted secrets with SOPS, Argo CD cannot compute the desired state. The sync status jumps to Unknown and nothing is synced – the running secrets stay as they are.
Symptom
argocd app get notes | grep -E "Sync Status|Health Status"
kubectl -n argocd get app notes -o jsonpath='{.status.conditions[0].message}'
Sync Status: Unknown
Health Status: Healthy
Failed to load target state: … loading generator plugins: failed to load generator: external plugins disabled; unable to load external plugin 'ksops'
Nothing breaks: notes keeps running, Argo CD just cannot compare.
Diagnosis
Locally, sops decrypt shows the same problem as long as SOPS_AGE_KEY_FILE is missing.
sops decrypt apps/notes/base/db-secret.enc.yaml Failed to get the data key required to decrypt the SOPS file. Group 0: FAILED age1cmppn2qlaapjw63t45skvazp5vsex5u7vf0l720lr5txfh9aq3dqattlrl: FAILED
Causes
ksops fehltThe repo-server does not know KSOPS
The generator secret-generator.yaml calls the Kustomize plugin ksops. The program does not exist in the repo-server, and Kustomize does not run foreign programs without permission.
SchlüsselThe private age key is missing
Without the private key SOPS cannot decrypt the data key – locally just as in the repo-server.
Fix
kubectl -n argocd create secret generic sops-age \
--from-file=keys.txt=$HOME/argo-lab/age.key
kubectl -n argocd patch deploy argocd-repo-server --patch-file repo-server-ksops.yaml
kubectl -n argocd patch cm argocd-cm --type merge \
-p '{"data":{"kustomize.buildOptions":"--enable-alpha-plugins --enable-exec"}}'
argocd app get notes --hard-refresh
secret/sops-age created
deployment.apps/argocd-repo-server patched
configmap/argocd-cm patched
Don't: Putting the private key into the Git repository to save time. Then the encryption is worthless.
GitOps with Argo CD hands-on, day 10: secrets with SOPS and age, the KSOPS generator and KSOPS in the repo-server.
Go to day 10 →
FAQ
Why is a normal refresh not enough?
The repo-server caches rendered manifests. --hard-refresh discards the cache so KSOPS really runs.
Are plaintext secrets visible in the UI afterwards?
No. argocd app manifests and the web UI show secret values only as ++++++++, decrypted ones included.