Deploy Argo CD Root Application
In this section we are going to apply a Custom Resource of kind Application and learn about a Custom Resource of kind Application Set.
Now that we have Argo CD deployed in our cluster, and we can access its web UI, we need to create an Argo CD application that tells Argo CD to sync manifests and helm charts from your repository.
Argo CD Application
The Application Custom Resource will tell Argo CD to deploy manifests under the apps/app-sets directory.
Since it is the first application that we deploy, and it tells Argo CD to deploy (child) manifests, we’ll call it root application.
Argo CD Application Set
The app-sets directory contains
Custom Resources of kind Application Set.
These Custom Resources will tell Argo CD to dynamically create Applications according to the file structure in your repository.
In our case, for each folder in the infra folder and services folder, create an Application with the configuration in the .yaml files.
For example, see the .yaml files in the postgres folder.
Flow
graph TD; rootApp[Argo CD root Application]---->infraAppSet[Argo CD Infra ApplicationSet] rootApp[Argo CD root Application]---->servicesAppSet[Argo CD Services ApplicationSet] infraAppSet---->extPostgresOperator[ext-postgres-operator chart] infraAppSet---->postgres[postgres chart] servicesAppSet-->samplePGApp[sample-pg-app chart]
Edit Argo CD Root Application
Before we apply the root application manifest, we need to set your repository’s URL (assuming you forked the repository, if you didn’t, please make sure you completed the steps in the intro).
Open the argocd-root-app.yaml manifest, and there, change the repoURL
to your repository’s URL.
Edit Argo CD Application sets
Open the services-app-set.yam manifest and update every instance of repoURL
to your repository’s URL.
Apply Argo CD Root Application
Now, after we’ve updated our manifests, we can apply our root application by executing:
kubectl apply -f ./values/argo-cd/argocd-root-app.yaml
Review The New Resources
Now we can go to the Argo CD UI and see the new applications being provisioned in the cluster!
From now on, we can go full GitOps!
This means, no more manual kubectl
commands, and every change to the manifests can be made by updating your repository.
Learn more
Congratulations! You’ve just deployed Argo CD and implemented the App of Apps pattern, you can read more about this pattern in Argo CD’s documentation.
Last updated 26 Feb 2024, 22:53 +0200 .