Skip to main content

Adding more workloads

Now that we've set up the foundation of the App of Apps pattern, we can add the additional workload Helm charts to the Git repository.

The repository structure will look like this after adding the application charts:

.
|-- app-of-apps
| |-- ...
|-- carts
| `-- Chart.yaml
|-- catalog
| `-- Chart.yaml
|-- checkout
| `-- Chart.yaml
|-- orders
| `-- Chart.yaml
`-- ui
`-- Chart.yaml

Let's copy the application chart files to our Git repository directory:

~$cp -R ~/environment/eks-workshop/modules/automation/gitops/argocd/app-charts/* \
~/environment/argocd/

Next, commit and push these changes to the Git repository:

~$git -C ~/environment/argocd add .
~$git -C ~/environment/argocd commit -am "Adding apps charts"
~$git -C ~/environment/argocd push

Sync the workload applications:

~$argocd app sync -l app.kubernetes.io/created-by=eks-workshop
~$argocd app wait -l app.kubernetes.io/created-by=eks-workshop --timeout 300
note

We sync the workload applications directly here, not the parent apps application. Syncing the parent would re-apply the same five Application resources it already created — nothing in its output changed, because this commit added the workload charts, not the App of Apps configuration.

Each workload application tracks its own path in the repository, so they are the ones that need to notice the new commit. Argo CD polls Git roughly every three minutes, and syncing forces that check immediately rather than waiting for the next poll.

When Argo CD completes the process, all our applications will be in the Synced state as shown in the Argo CD UI:

argocd-ui-apps.png

We should now see a set of new namespaces with each application component deployed:

~$kubectl get namespaces
NAME              STATUS   AGE
carts             Active   28s
catalog           Active   28s
checkout          Active   28s
default           Active   8h
kube-node-lease   Active   8h
kube-public       Active   8h
kube-system       Active   8h
orders            Active   28s
ui                Active   11m

Let's examine one of the deployed workloads more closely. For example, we can check the carts component:

~$kubectl get deployment -n carts
NAME    READY   UP-TO-DATE   AVAILABLE   AGE
carts   1/1     1            1           46s

This confirms that our GitOps-based deployment using the App of Apps pattern has successfully deployed all microservices to our cluster.