DEV Community

Isaac kumi
Isaac kumi

Posted on • Updated on

Deploying ArgoCD on Minikube with Terraform and Helm: A Step-by-Step Guide


Prerequisites

Before diving into deploying ArgoCD on Minikube, make sure you have the following prerequisites installed on your system:

  • Docker
  • Minikube
  • Terraform
  • Helm
  • kubectl

For this guide, we're using a two-node cluster on Minikube, although one node should suffice.

Start Minikube with two nodes using this command:

minikube start --nodes 2 -p argocd-helm
Enter fullscreen mode Exit fullscreen mode

Verify your Minikube setup with:

kubectl get nodes
Enter fullscreen mode Exit fullscreen mode

Next, set up your project directory:

mkdir -p terraform/values
cd terraform && touch provider.tf main.tf
cd terraform/values && touch argocd.yaml
Enter fullscreen mode Exit fullscreen mode

Now, let's configure Terraform to deploy ArgoCD using Helm.

terraform/provider.tf

provider "helm" {
  kubernetes {
    config_path = "~/.kube/config"
  }
}
Enter fullscreen mode Exit fullscreen mode

terraform/main.tf

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("values/argocd.yaml")]
}
Enter fullscreen mode Exit fullscreen mode

In terraform/values/argocd.yaml, you can override some default ArgoCD Helm chart values:

global:
  image:
    tag: "v2.6.6"

server:
  extraArgs:
  - --insecure
Enter fullscreen mode Exit fullscreen mode

After setting up your Terraform configuration, execute the following commands in your terminal:

terraform init
terraform apply --auto-approve
Enter fullscreen mode Exit fullscreen mode

terraform init

Verify the ArgoCD deployment with:

kubectl get pods -n argocd
Enter fullscreen mode Exit fullscreen mode

kubectl get pods -n argocd
To access the ArgoCD web UI, you'll need to port forward to the argocd-server service:

kubectl port-forward svc/argocd-server -n argocd 8080:80
Enter fullscreen mode Exit fullscreen mode

kubectl port-forward
Now, open your browser and navigate to localhost:8080. You should see the ArgoCD login page.

The default username is admin. Retrieve the password from the secret using:

kubectl get secrets argocd-initial-admin-secret -o yaml -n argocd
Enter fullscreen mode Exit fullscreen mode

kubectl get secrets
Copy the password and decode it with the base64 utility:

echo "copied_password_here" | base64 -d
Enter fullscreen mode Exit fullscreen mode

echo "copied_password_here" | base64 -d
Now, paste the decoded password without the % sign at the end into the password field on the login page.

Voila! You've successfully deployed ArgoCD on Minikube.


Top comments (0)