gitops-bridge-dev / gitops-bridge

Apache License 2.0
340 stars 86 forks source link

Sync Waves (aka ordering) Application Sets and Apps #70

Open csantanapr opened 4 months ago

csantanapr commented 4 months ago

This is an issue to capture the different solutions to have order of installation for application sets and apps.

Background:

There are 2 ways today you can do ordering when workign with Application Sets

  1. You can set a sync wave number on an Application Set and increase the delay between syncs from 2 seconds higher like 30 seconds. This only is applicable if you are installing application sets for single cluster, meaning each cluster in your fleet of clusters has an instances of argocd and the group of application sets for addons is deployed to each independently of each other (ie. Not doing hub-spoke) here is an example https://github.com/csantanapr/argocd-experiments-syncwaves
  2. You can implement a presync in the App generated by the application set. This presync will run a kube job that has kubectl CLI and a script that will check for the dependency before exit with 0, the check can be on another deployment (cert manager deployment) or check that CRDs exist.
csantanapr commented 4 months ago

I want to experiment with an annotation "dependsOn: otherargocdapp" and a validation webhook that would check the status of another argocd app and delay the response up to 30 seconds so it can work on first attemps, and have the Apps have retry, by the next try it should work.