title: ArgoCD sync waves between apps
body: <p>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.</p>
  <p>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.</p>
  <p>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 <code>-1</code>, with others in the default <code>0</code></p>
  <pre><code>kind: Application
  metadata:
    name: &quot;A&quot;
    annotations:
      argocd.argoproj.io/sync-wave: &quot;-1&quot;
  </code></pre>
  <p>Our original assumption (perhaps foolishly) was that sync coordination applied <strong>within a project</strong>, however, it seems that it is only applied <strong>within an app</strong>.</p>
  <p>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.</p>
  <p>Is there a way to control the order / dependencies of syncing between apps inside a project?</p>
  <p>I have seen mention of an &quot;app-of-apps&quot; 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?</p>