Skip to content

cluster: ObjectStore helm hook breaks backups under ArgoCD #964

Description

@yama6a

What's wrong

With the plugin backup method, the chart renders the ObjectStore with: "helm.sh/hook": pre-install,pre-upgrade,pre-rollback

(in backup-objectstore.yaml and recovery-objectstore.yaml, from #924).

Fine in plain Helm, it jsut orders the ObjectStore before the Cluster. But under ArgoCD a Helm hook becomes an ephemeral PreSync resource, so ArgoCD creates it once and then prunes it. It never comes back: WAL archiving stops and the Cluster goes Ready=False with ContinuousArchivingFailing: ObjectStore ... not found, wedging the whole app sync.

Repro

backups.method: plugin synced by ArgoCD (auto-sync + prune) -> ObjectStore applied as a PreSync hook, then pruned, and archiving breaks.

For now, I've worked around it by rendering the CNPG CRs myself instead of using this chart directly, so the ObjectStore has no helm hook and ArgoCD keeps it as a normal tracked resource, wtih an argocd.argoproj.io/sync-wave: "-1" for ordering.

Suggested fix

Make the hook optional, (default enabled, to not causea BC break of course)

    backups:
      objectStore:
        helmHook: true      # set false for ArgoCD/Flux
        annotations: {}      # e.g. argocd.argoproj.io/sync-wave: "-1"

When false, drop the hook annotation. The annotations map lets GitOps users add their own ordering without leaking it onto the Cluster like the existing cluster.annotations passthrough would. I'd apply it to both the backup and recovery ObjectStores.

Happy to open a PR (templates + values + schema + docs + chainsaw test) if the approach works for you. just wanted to check the approach first.

// Edit: it was kindof a small change, so I already created the PR. No hard feelings if you reject it or prefer a different approach :)
#965

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingchart( cluster )Related to the cluster chart

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions