Getting Started with ArgoCD
Tags: argocd, gitops, beginners
Published: 2023-03-07 12:10:16

## Overview
In this blog, we shall discuss what ArgoCD is, and how to install it.

## ArgoCD
Quoting [ArgoCD's website](https://argo-cd.readthedocs.io/en/stable/), 

> ArgoCD is a declarative, gitops Continuous Delivery tool for Kubernetes.

But what is declarative? What is GitOps? and What is Continuous Delivery? Let's understand them one by one, in reverse order.

### Continuous Delivery
Continuous Delivery is a software engineering approach, in which code changes are automatically prepared for release in production.

Continuous Delivery is often aided by Continuous Integration. The process says that, once a developer pushes some code, Continuous Integration is leveraged to test the code. Once the code is tested and all the tests are passed, Continuous Delivery tools take the baton, and deploy the code into various environments (i.e. QA, Staging, etc).

### GitOps
The term `GitOps` was coined in 2017 by [Weaveworks](https://www.weave.works/). Since its inception, it has caught a lot of attention.

GitOps is a way of implementing Continuous Deployment for cloud native applications.

NOTE: Continuous Deployment is almost same to Continuous Delivery, the only difference is that application deployment in production environment requires Approval in Continuous Delivery, while Continuous Deployment directly deploys the code in the production as well.

The main idea behind GitOps is to have a Git repository, which contains the declarative description of the desired infrastructure for the particular environments (let's say production) and an automated process to keep the production environment in the desired state. ArgoCD is one such tool which is capable of doing this.

We will understand this more when we'll deploy our first application using ArgoCD.

### Declarative
ArgoCD is declarative in nature. It means that whatever state we define in a manifest file will be achieved by ArgoCD. There is no need to define the procedure.

## Installing ArgoCD

### Pre-requisites
- a kuebrnetes cluster (We shall be using Minikube as a primary cluster for further blogs in this series, to know how to install minikube, please refer to [Minikube documentation](https://minikube.sigs.k8s.io/docs/start/)).
- `kubectl` utility to interact with the kubernetes cluster you have access to (To install kubectl utility, please refer to [Kubernetes documentation](https://kubernetes.io/docs/tasks/tools/#kubectl)).

### Installation

There are multiple ways to install Argo CD. You can simply install it by applying plain manifests. You can also use helm chart to deploy it. In case you have an OCP/OKD cluster, then most probably you might want to go with Operator based installation. We are going to discuss the manifests way and helm way in this blog. For operator based installation, please refer the [official Argo CD Operator documentation](https://argocd-operator.readthedocs.io/en/latest/install/start/).

The most beginner-friendly way to install Argo CD is to directly deploy it using plain Kubernetes manifests. Run the following commands to do that:

```sh
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
```

If you want to install Argo using Helm chart,then first add the Argo CD repository to your helm repositories list using the following command:
```sh
helm repo add argo https://argoproj.github.io/argo-helm
```

If you have already added the repository, please run the following command to fetch the information about updated versions:
```sh
helm repo update
```

Now that we have added the helm repository, run the following command to install Argo CD using helm:
```sh
helm install argocd argo/argo-cd --version 5.43.0 -n argocd --create-namespace
```

The above command will install Argo CD in `argocd` namespace. In the next blog post of this series, we will explore how to login, and we will also deploy our first application via Argo CD.