This article explores the App-of-Apps pattern in ArgoCD for managing multiple applications through a single root configuration.
In this article, we dive into the App-of-Apps pattern in ArgoCD—a declarative approach that streamlines the creation and management of ArgoCD applications. Instead of manually deploying each application, the App-of-Apps pattern programmatically generates and manages multiple ArgoCD applications from a single root configuration.The core idea is to create a root ArgoCD application whose source points to a folder containing YAML definition files for each microservice or application. Each YAML file specifies a path to a directory containing the relevant Kubernetes manifests. Once all these configuration files are committed to a Git repository, ArgoCD automatically detects and deploys the defined applications.
The root application acts as an orchestrator. It cues ArgoCD to traverse the specified directory, reading every YAML file to instantiate the associated applications. This ensures that updates in your Git repository trigger automatic synchronization with your Kubernetes cluster.
Assume your Git repository is organized so that each directory holds the necessary files for a specific application. The following example reviews the root ArgoCD application’s YAML file, which is placed within a multi-application directory. This root application points to the “app-of-apps” directory, prompting ArgoCD to create all the child applications as defined in that folder.
In this example, three ArgoCD application YAML files are defined within the specified directory. ArgoCD reads these definitions and automatically creates the corresponding applications.
Let’s examine the Circle App YAML file as an example. Every application YAML includes a source field that refers to its specific manifest directory. In the Circle App, ArgoCD uses the provided details to create or update the deployment and service in the Kubernetes cluster.
Using this pattern, ArgoCD automatically creates all listed applications and deploys their associated Kubernetes manifests. This approach can be extended to manage any Kubernetes object—including ArgoCD itself. Whenever an application definition is updated or a new one is added to your Git repository, ArgoCD ensures your deployments remain in sync by automatically updating or creating the corresponding applications.
Using the App-of-Apps pattern simplifies complex deployments and improves operational efficiency, making it an essential tool in modern GitOps-based workflows.