Introduction to Argo CD – Continuous Deployment/ Delivery with Argo CD

Argo CD is an open source, declarative, GitOps- based CD tool designed to automate deploying and managing applications and infrastructure on Kubernetes clusters. Argo CD serves as a robust application controller, efficiently managing and ensuring the smooth and secure operation of your applications. Argo CD works in the pull-based GitOps model and, therefore, polls the Environment repository regularly to detect any configuration drift. Suppose it finds any drift between the state in Git and the actual state of applications running in the environment. In that case, it will make corrective changes to reflect the desired configuration declared in the Git repository.

Argo CD is tailored explicitly to Kubernetes environments, making it a popular choice for managing applications on Kubernetes clusters.

In addition to the traditional Kubernetes manifest YAML files, Argo CD offers support for various alternative methods of defining Kubernetes configurations:
• Helm charts
• Kustomize
• Ksonnet
• Jsonnet files
• Plain YAML/JSON manifest files
• Integration with other customized configuration management tools through plugins

Within Argo CD, you can define applications encompassing both a source and a target. The source specifies details about the associated Git repository, the location of the manifests, helm charts, or kustomize files, and then applies these configurations to designated target environments. This empowers you to monitor changes within a specific branch, tag, or watch particular versions within your Git repository. Diverse tracking strategies are also at your disposal.

You can access a user-friendly web-based UI and a command-line interface (CLI) to interact with Argo CD. Moreover, Argo CD facilitates reporting on the application’s status via sync hooks and app actions. If any modifications are made directly within the cluster that deviate from the GitOps approach, Argo CD can promptly notify your team, perhaps through a Slack channel.

The following diagram provides an overview of the Argo CD architecture:

Figure 12.9 – Argo CD architecture

So, without further ado, let’s spin up Argo CD.
Installing and setting up Argo CD

Installing Argo CD is simple – we need to apply the install.yaml manifest bundle that’s available online at https://github.com/argoproj/argo-cd/blob/master/manifests/ install.yaml on the Kubernetes cluster where we wish to install it. For a more customized installation, you can refer to https://argo-cd.readthedocs.io/en/stable/operator-manual/installation/.

As we’re using GitOps for this chapter, we will not deploy Argo CD manually. Instead, we will use Terraform to set it up using the Environment repository.

The resources for this section are present in ~/modern-devops/ch12/environments-argocd-app. We will use the same Environment repository as before for managing this environment.

Therefore, let’s cd into the mdo-environments local repository and run the following commands:
$ cd ~/mdo-environments
$ cp -r ~/modern-devops/ch12/environments-argocd-app/terraform .
$ cp -r ~/modern-devops/ch12/environments-argocd-app/manifests .
$ cp -r ~/modern-devops/ch12/environments-argocd-app/.github .

Now, let’s look at the directory structure to understand what we’re doing:
├── .github
│ └── workflows
│ └── create-cluster.yml ├── manifests
│ └── argocd
│ ├── apps.yaml
│ ├── install.yaml
│ └── namespace.yaml └── terraform
├── app.tf ├── argocd.tf ├── cluster.tf ├── provider.tf └── variables.tf

As we can see, the structure is similar to before, except for a few changes. Let’s look at the Terraform configuration first.

Leave a Reply

Your email address will not be published. Required fields are marked *



          Terms of Use | About Breannaworld | Privacy Policy | Cookies | Accessibility Help | Contact Breannaworld