Setup
Before we start to setup Argo CD applications, let's delete Argo CD Application
which we created for ui
:
We create templates for set of AroCD applications using DRY approach in Helm charts:
.
|-- app-of-apps
| |-- Chart.yaml
| |-- templates
| | |-- _application.yaml
| | `-- application.yaml
| `-- values.yaml
`-- apps-kustomization
...
Chart.yaml
is a boiler-plate. templates
contains a template file which will be used to create applications defined in values.yaml.
values.yaml
also contains values which are specific for a particular environment and which will be applied to all application templates.
spec:
destination:
server: https://kubernetes.default.svc
source:
repoURL: ${GITOPS_REPO_URL_ARGOCD}
targetRevision: main
applications:
- name: assets
- name: carts
- name: catalog
- name: checkout
- name: orders
- name: other
- name: rabbitmq
- name: ui
First, copy App of Apps
configuration which we described above to the Git repository directory:
Next, push changes to the Git repository:
Finally, we need to create new Argo CD Application
to support App of Apps
pattern.
We define a new path to Argo CD Application
using --path app-of-apps
.
We also enable ArgoCD Application to automatically synchronize the state in the cluster with the configuration in the Git repository using --sync-policy automated
application 'apps' created
The default Refresh
interval is 3 minutes (180 seconds). You could change the interval by updating the "timeout.reconciliation" value in the argocd-cm config map. If the interval is to 0 then Argo CD will not poll Git repositories automatically and alternative methods such as webhooks and/or manual syncs should be used.
For training purposes, let's set Refresh
interval to 5s and restart argocd application controller to deploy our changes faster
Open the Argo CD UI and navigate to the apps
application.
Click Refresh
and Sync
in ArgoCD UI, use argocd
CLI to Sync
the application or wait until automatic Sync
will be finished:
We have Argo CD App of Apps Application
deployed and synced.
Our applications, except Argo CD App of Apps Application
, are in Unknown
state because we didn't deploy their configuration yet.
We will deploy application configurations for the applications in the next step.