Sub topic 13
Reading status and debugging failed syncs
This chapter assumes you have applied a SecretStore and an ExternalSecret as in the earlier chapters. You should be comfortable with kubectl describe and with reading Pod logs.
Where ESO reports problems
ESO does not fail loudly. A broken ExternalSecret leaves the target Secret missing or stale, and the cause is recorded on the resources themselves. Check three places, in this order:
- The status and conditions of the ExternalSecret.
- The status of the store it references.
- The controller logs.
Step 1: check the ExternalSecret
kubectl get externalsecret db-credentials -n app
kubectl describe externalsecret db-credentials -n app
kubectl get secret db-credentials -n app -o jsonpath='{.data.password}' | base64 -dThe get output has a STATUS column and a READY column. A healthy resource shows SecretSynced and True. In describe, read the Conditions block and the Events list. The condition has a reason and a message, and the message usually quotes the provider's error. The status also holds refreshTime, which is when the last successful sync ran.
| Status reason | Meaning | Typical cause |
|---|---|---|
| `SecretSynced` | Last sync succeeded | None |
| `SecretSyncedError` | Last sync failed | Store, auth, key or template problem |
| `SecretDeleted` | Target Secret was removed | Deletion policy or manual delete |
If the sync fails after an earlier success, ESO keeps the old Secret. Your Pods keep running with stale data, so a failing ExternalSecret is easy to miss.
Step 2: check the store
An ExternalSecret cannot sync if its store is unhealthy. ESO validates the store by contacting the provider.
kubectl get secretstore aws-store -n app
kubectl get clustersecretstore aws-sharedA READY value of False points to authentication or connectivity. Run kubectl describe on the store to see the provider message.
Step 3: read the controller logs
kubectl logs -n external-secrets deploy/external-secrets --tail=50Logs show reconcile errors with the resource name and namespace. Filter on your ExternalSecret name.
Common failures
- Access denied from the provider. The identity the store uses lacks permission. For IRSA, check that the
eso-readerServiceAccount carries the correct role annotation and that the role allowssecretsmanager:GetSecretValueon the secret. - Secret or property not found.
remoteRef.keyorpropertydoes not match the remote name. Names are case sensitive, and apropertyonly works on JSON secrets. - Store not found or not ready.
secretStoreRef.kindis wrong. A namespacedSecretStoremust live in the same namespace as the ExternalSecret. - Namespace not allowed. A ClusterSecretStore with
conditionsrejects ExternalSecrets from namespaces that are not listed. - Template error. A template references a key the remote secret does not contain, such as
.username. - Target already exists. With
creationPolicy: Owner, ESO will not take over a Secret that another controller or person created. - Unknown kind or apiVersion. The CRDs are missing, or you used
external-secrets.io/v1on an older release that only servesv1beta1.
Forcing a retry
After you fix the cause, ESO retries with backoff. To skip the wait, change an annotation, which triggers a reconcile:
kubectl annotate externalsecret db-credentials -n app force-sync=$(date +%s) --overwriteThen run kubectl get externalsecret again and confirm SecretSynced.
Exercise
An ExternalSecret was healthy yesterday and now shows SecretSyncedError, but the application still works. Why does it still work, and where do you look first?
Show answer
ESO leaves the last synced Secret in place when a refresh fails, so Pods keep reading the old value. Run kubectl describe externalsecret and read the condition message and events. Then check the store with kubectl get secretstore (or clustersecretstore) for an authentication failure.