Skip to content

Conversation

zvlb
Copy link
Contributor

@zvlb zvlb commented Oct 14, 2025

This PR adds an ArgoCD hook annotation to ensure CRDs are created/updated before other resources during ArgoCD deployments.

Problem:
When deploying Capsule via ArgoCD, CRDs are applied simultaneously with other resources, causing installation failures when custom resources are processed before CRDs are ready.

Solution:
The PreSync hook ensures CRDs are properly installed and available before ArgoCD proceeds with syncing the remaining resources, enabling successful Capsule deployment in ArgoCD-managed clusters.

More informations about ArgoCD sync phases here

@zvlb zvlb changed the title fix (chart): add ArgoCD annotations for CRD lifecycle job fix(chart): add ArgoCD annotations for CRD lifecycle job Oct 14, 2025
@zvlb zvlb changed the title fix(chart): add ArgoCD annotations for CRD lifecycle job fix(chart): add argocd annotations for crd lifecycle job Oct 14, 2025
@zvlb
Copy link
Contributor Author

zvlb commented Oct 14, 2025

Same for capsule proxy

@sandert-k8s
Copy link
Contributor

Hi,

I'm unsure if this will do/fix anything, since ArgoCD already maps these helm hooks to argocd hooks, see https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-hooks .
When using the crd install job (which is the recommended way of installation), you should disable the installation of crd's through argocd.
And in the helm chart, enable the crd job (by default enabled)

crds:
  install: true

Does this solve the issue? What kind of issues do you encounter when setting/not setting these hook annotations?

@zvlb
Copy link
Contributor Author

zvlb commented Oct 16, 2025

I'm not sure if the annotation
"helm.sh/hook": "pre-install,pre-upgrade"
is being processed correctly by ArgoCD.
Perhaps it needs to have only one value specified?

When I use

crds:
  install: true

My ArgoCD workflows start running before the job that installs the CRDs is executed, and everything fails.

@sandert-k8s
Copy link
Contributor

Did you disable the installation of the CRD's in the ArgoCD Application spec? https://argo-cd.readthedocs.io/en/latest/user-guide/helm/#helm-skip-crds

@sandert-k8s
Copy link
Contributor

I think I've spotted the problem. ArgoCD does a dry sync of all resources, and when the installation of the CRD's is set to false in the ArgoCD application spec, it fails to Sync on the initial sync becauses it tries a dryrun on the CapsuleConfiguration which isn't yet possible.

Could you set

customAnnotations:
  argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true

in the values of Capsule? I think the initial installation should succeed then.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants