Setup ArgoCD in AWS EKS Cluster Using Terraform

Ravindra singh
3 min readMay 3, 2023

--

ArgoCD is a powerful continuous delivery tool that allows you to deploy your applications and configurations to your Kubernetes clusters with ease. In this blog post, we will guide you through the steps to install and configure ArgoCD in an Amazon Web Services (AWS) Elastic Kubernetes Service (EKS) cluster.

Prerequisites Before you begin, you should have the following prerequisites in place:

  1. An AWS EKS cluster set up and running. You can create a cluster using the EKS console or the AWS CLI.
    You can refer below Video to Create AWS EKS Cluster in AWS.
  1. kubectl installed and configured to connect to your EKS cluster. You can follow the official Kubernetes documentation to install kubectl.
  2. Helm 3 installed. You can follow the official Helm documentation to install Helm.

Why Argo CD?

It allows teams to achieve GitOps, which has the following principles:

  1. Automated Deployment: ArgoCD automates the deployment process of your applications, ensuring that your Kubernetes cluster is always up-to-date with the latest changes in your Git repository.
  2. Rollbacks and Revisions: ArgoCD supports rollbacks and revisions, allowing you to quickly and easily revert to a previous version of your application in case of issues or errors.
  3. Monitoring: ArgoCD provides built-in monitoring and alerting capabilities, making it easier to keep track of the health and status of your applications.

Things We Will Do!

Since our focus is to implement GitOps, we will declare everything, including the installation of Argo CD and the configuration of our application on Argo CD. We will use Terraform to install the ArgoCD

  1. Create a GKE cluster.
  2. Install Argo CD on it.

Now, let’s look at the Terraform configuration.

setup.yaml

resource "helm_release" "argocd" {
name = "argocd"
repository = "https://argoproj.github.io/argo-helm"
chart = "argo-cd"
namespace = "argocd"
create_namespace = true
version = "3.35.4"
values = [file("argocd.yaml")]
}
# helm install argocd -n argocd -f values/argocd.yaml

provider.tf

provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
}
terraform {
required_version = ">= 1.0.0"

required_providers {
helm = {
source = "hashicorp/helm"
version = "= 2.5.1"
}
}
}

values.yaml

---
global:
image:
tag: "v2.6.6"

dex:
enabled: false

server:
extraArgs:
- --insecure

Accessing the Argo CD Web UI

To access the Argo CD Web UI, you need to port-forward argocd-server service.

Run the following command to get the password

Let’s decode base64 encoded string

echo “Z1RpcFFuUjc4UmI4bTliNw==” | base64 -d

Now let’s log in using the credentials.

“If you prefer a video tutorial to help guide you through the process of installing ArgoCD on an AWS EKS cluster, be sure to check out my YouTube video on the topic for step-by-step instructions.”

Conclusion

Thanks for reading! I hope you enjoyed the article.

--

--