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: Applicationmetadata: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?

2

Best Answer


As of version 1.8 of ArgoCD the part responsible for making this possible has been removed. More details can be found here .

The argocd-cm will need to be updated to enable the app of an app health check using resource.customizations part like on below example. More details can be found here and here.

---apiVersion: v1kind: ConfigMapmetadata:name: argocd-cmnamespace: argocdlabels:app.kubernetes.io/name: argocd-cmapp.kubernetes.io/part-of: argocddata:resource.customizations: |argoproj.io/Application:health.lua: |hs = {}hs.status = "Progressing"hs.message = ""if obj.status ~= nil thenif obj.status.health ~= nil thenhs.status = obj.status.health.statusif obj.status.health.message ~= nil thenhs.message = obj.status.health.messageendendendreturn hs

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).