EAI-8232 Stop using PreSync hooks for seaweedfs ExternalSecrets - #821
Merged
Conversation
Argo does not track hook resources, so selfHeal cannot restore them. Once the ExternalSecret is gone the app still reports Synced/Healthy and nothing recreates it, and ESO's owner reference takes the target Secret seaweedfs-s3-config with it. Drop the hook annotation from both ExternalSecrets so they become normal tracked resources. Ordering is unchanged: waves -2 and -1 still run before their consumers at wave 0, and Argo gates the wave on the ExternalSecret health check. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ecrets Now that the ExternalSecrets are tracked rather than PreSync hooks, Argo diffs them for the first time. The ESO CRD defaults conversionStrategy, decodingStrategy and metadataPolicy inside each spec.data[].remoteRef, and Argo's predicted live state drops them because they sit in a list item, so seaweedfs-config stayed OutOfSync forever while Healthy. Ignore those three fields, matching what airm-infra-external-secrets, aiwb-infra-external-secrets, argocd-config, cluster-auth-config, kaiwo-config and keycloak already do. The size presets only override valuesObject, so this applies to small, medium and large alike. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
lauri-amd
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
seaweedfs-configreportedSynced / HealthywhileSecret/seaweedfs-s3-configdid not exist, leavingseaweed-s3stuck inContainerCreatingindefinitely. ArgoCD showed nothing wrong, so the failure was invisible.Root cause
Two parts, the second non-obvious:
1. Sync hooks are not tracked resources. Both seaweedfs ExternalSecrets carried
argocd.argoproj.io/hook: PreSync. ArgoCD excludes hook resources from an Application's resource tree, soselfHealcan never restore them — once the ExternalSecret was gone, nothing brought it back, and its target Secret went with it viaownerReferenceGC (creationPolicy: Owner). The app kept reporting Healthy because the missing resources weren't in the tree it evaluates. The diagnostic tell is a blank sync status in.status.resources[].2. Un-hooking alone causes permanent OutOfSync. Once tracked, the ESO CRD defaults three fields inside every
spec.data[].remoteRef:conversionStrategy,decodingStrategy,metadataPolicy. ArgoCD computes OutOfSync by comparing live state against predicted live state, and the predicted state drops fields nested inside list items (lists are replaced wholesale, not merged). Live therefore never equals predicted and the app sits OutOfSync forever while Healthy. Note that top-level defaulted fields such astarget.creationPolicydo not diff — only fields insidespec.data[].Changes
argocd.argoproj.io/hook: PreSyncfromseaweedfs-es-s3-configandseaweed-admin-es-secret. Sync-waves-2/-1are retained, which preserves the original ordering intent (Secret materialised before the Seaweed CR syncs) without the hook's tracking blind spot.ignoreDifferencesentry forExternalSecretonseaweedfs-configcovering the three CRD-defaultedremoteRefpaths, so the now-tracked resources converge.Testing
Verified end-to-end on two clean clusters built from scratch with cluster-bloom.
Single-node,
CLUSTER_SIZE: mediumand 3-node all-control-plane,CLUSTER_SIZE: large. The second is a materially different code path, not just a bigger cluster: Longhorn distributed storage instead of local-path-provisioner, two cilium-operator replicas, and consequently SeaweedFS deployed as 3 masters + 3 volume replicas rather than 1 + 1.Results on the 3-node cluster — 19 checks, 0 failures:
seaweedfs-configreachedSynced / Healthyunaided.SecretSynced; both target Secrets present with correct ownerReferences;s3.jsonvalid.seaweed-s3Running — the reported symptom does not occur.Regression test, deleting the ExternalSecret and watching recovery with no intervention:
11s on the 3-node cluster, ~105s single-node. Under the old hook the same deletion left the app reporting
Synced / Healthywith the Secret permanently absent — that contrast is the fix.Two apps had not converged at the end of the run, both unrelated and confined to their own namespaces:
airmDegraded onsecret "airm-rabbitmq-common-vhost-user" not found(no seaweedfs or s3 references anywhere in the airm namespace; also Degraded before this change), andenvoy-gateway-configProgressing while still settling.Follow-up (not in this PR)
The same hook pattern remains on
gitea-config(gitea-devuser-secret,gitea-oidc-secret),kaiwo-config(minio-credentials-fetcher),keycloak(keycloak-cnpg-user-credentials) andotel-lgtm-stack(grafana-admin-credentials), all carrying the identical latent defect —keycloak-cnpg-user-credentialswas observed live with the tell-tale blank sync status. When those are un-hooked,gitea-configandotel-lgtm-stackwill also need the ExternalSecretignoreDifferencesentry added, or they will land in the permanent-OutOfSync-while-Healthy state described above. To be handled in a separate ticket.Refs EAI-8232.
🤖 Generated with Claude Code