ArgoCD Setup on EKS

ArgoCD Setup on EKS
Photo by Joshua Woroniecki / Unsplash

Introduction

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. It provides a way to automate the deployment of applications to Kubernetes clusters using Git as the single source of truth for defining and managing the desired state of your applications.

Argo CD can help you to manage the complexity of deploying and managing applications in a Kubernetes cluster. It provides a unified view of all your applications, their current state, and the history of changes to the cluster. With Argo CD, you can easily deploy and roll back changes to your applications, and you can monitor the health of your applications to ensure they are running as expected.

Here are some reasons why you might want to use Argo CD:

  1. Simplify deployment management: Argo CD allows you to manage your Kubernetes applications using a declarative approach, which reduces the complexity of managing deployments.
  2. Automate the deployment process: With Argo CD, you can automate the deployment of applications to Kubernetes clusters, making it easier to manage and maintain your applications.
  3. Improve collaboration: By using Git as the single source of truth, Argo CD makes it easier for teams to collaborate on application deployment and management.
  4. Improve security: Argo CD provides a secure way to manage Kubernetes applications, with built-in support for RBAC and auditing.
  5. Gain visibility: Argo CD provides a unified view of all your applications and their current state, making it easier to monitor and troubleshoot issues.
💡
In this article, I assume that you already have a working and functional EKS cluster.

Why do I need to use ArgoCD?

Argo CD provides a powerful set of tools for managing Kubernetes applications, making it a valuable tool for developers and operations teams who want to simplify the management of complex deployments and improve the reliability and security of their applications.

Requirements

Install ArgoCD

The installation steps are actually very short and simple. The ArgoCD team provides a helpful operator for installation.

The Argo CD operator is used to manage the Argo CD installation. You can install the operator using the kubectl command-line tool

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

Expose the Argo CD API server: By default, the Argo CD API server is only accessible within the Kubernetes cluster. You can expose it using a Kubernetes service

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/argocd-service.yaml

Create an ingress resource: To access the Argo CD UI from outside the cluster, you need to create an ingress resource. You can do this using the following command

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/argocd-ingress.yaml

To configure Argo CD using the web UI, you can access the Argo CD dashboard by opening the URL of the ingress resource you created in step 4 in your web browser. You will need to log in using the default username and password, which are admin and the auto-generated password.

You can grab the auto-generated password with the following command

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d > admin-pass.txt

Sample Helm Chart

Starting a new Helm chart requires one simple command

helm create sample-helm-chart

After Helm Chart is created, you can populate it with your values. I'll leave it with default values. I just copy the repository URL and I'll use it in the next step.

ArgoCD Application Creation

You can create applications via UI, Argo CLI, or simple kubectl commands. Let's create a new application via UI.

Click NEW APP from the top left side of the ArgoCD dashboard. Start filling in the values below.

Thats it. You have successfully created a new ArgoCD application.

Conclusion

Thanks to ArgoCD, we can make declarative deployments. If we integrate ArgoCD with the pipeline, we can sync all the changes simultaneously.

See you in the next article.

The sample helm chart can be found here:

habil-dev-blog/sample-helm-chart at main · habil/habil-dev-blog
Contains materials used in blog posts. Contribute to habil/habil-dev-blog development by creating an account on GitHub.