We have an ArgoCD project. In this project we have multiple apps (lets call them A, B, and C), which pass messages to each other via a Kafka cluster. In order to do this the topics need to be created.
App A is responsible for managing the Kafka cluster (amongst other things). We have a PreSync hook in app A for a job to create and configure the topics before updating the other resources, which apps B and C depend on.
This means that we need app A to sync before the other apps to ensure smooth rollout. To try to manage this we added app A to SyncWave -1
, with others in the default 0
kind: Application
metadata:
name: "A"
annotations:
argocd.argoproj.io/sync-wave: "-1"
Our original assumption (perhaps foolishly) was that sync coordination applied within a project, however, it seems that it is only applied within an app.
So what happens is that the resources in app A wait for the PreSync hook to provision the topics as expected, but apps B and C do not wait for app A to be in sync.
Is there a way to control the order / dependencies of syncing between apps inside a project?
I have seen mention of an "app-of-apps" pattern, where you have one app which deploys all other apps. Would doing this allow us to leverage the SyncWave to ensure that app A fully resolves before attempting to sync apps B and C? If not, is there another way?
We have an app-of-apps (bootstrap app) and that is how we orchestrate sync-waves between apps. I have had no luck however ALSO adding sync-waves to the manifests IN each app. Seems from the docs that manifests are applied by Kind (e.g., namespaces first) and then alphabetically by name (case insensitive).