How to Setup and Connect ArgoCD with AKS in 5 mins¶
🏷️Tagged with:
ArgoCD is a powerful tool that utilizes GitOps principles to automate and streamline your Kubernetes application deployments. It continuously monitors your Git repository, acting as the single source of truth for your desired application state. When it detects a change, ArgoCD controller automatically reconciles the running applications with the configurations in your Git repository, ensuring a consistent and version-controlled deployment process.
In this guide, I’ll walk you through setting up ArgoCD on your AKS cluster to manage deployments of Python applications stored in a private registry. While the demo uses a python flask deployment and service file for illustrative purposes (ingress, external DNS and cert manager is on the way!), you can easily substitute it with the NGINX application manifests on our repo. The deployment YAML for NGINX is provided in kuberada labs repo for reference, you can find the nginx manifest files there.
All the codes used:
Manifest and terraform files:
Let’s dive in!
Prerequisites:
An existing Azure subscription with AKS cluster creation permissions
Azure CLI installed and configured with your subscription
kubectl configured to access your AKS cluster
Basic understanding of Kubernetes concepts
Creating the AKS Cluster:
If you don’t have an AKS cluster, you can create one using the Azure CLI or terraform. Refer to Microsoft’s documentation for detailed instructions.
While this guide focuses on deploying ArgoCD on an existing AKS cluster, you can spin up a minikube, k3d cluster too. If you don’t have one, you can easily create one using the Azure CLI or the terraform code we store on https://github.com/colossus06/Kuberada-Blog-Labs/tree/main/argocd.
Installing ArgoCD on AKS¶
Download the ArgoCD Manifest¶
Start by downloading the ArgoCD manifest file from the ArgoCD repository.
wget https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Configure ArgoCD¶
Rename the install.yaml
file to argo-cm-nodeport.yaml
and configure ArgoCD for your environment:
Disable TLS and configure insecure connection:
data: server.insecure: "true"
Change the
argocd-server
service type to NodePort:spec: type: NodePort
Connect SCM and ArgoCD¶
Since we are using a private repo, we need to create a secret to authenticate with your private Git repository. If you’re using the sample nginx manifest file, you can safely skip this step.
Deploy ArgoCD¶
Apply the modified argo-cm-nodeport.yaml
file and the secret to deploy ArgoCD:
Access the ArgoCD UI¶
Open the ArgoCD UI using port forwarding:
kubectl port-forward svc/argocd-server -n argocd 8080:443
Access the UI at http://localhost:8080
and log in with the default username admin and password you get with following the gist.
Validation¶
As you can see, repo and application is already setup and the status is healthy. We didn’t interact with the cluster directly instead delegated out github repo as the single source of truth.
Conclusion¶
Congratulations!
You’ve successfully set up ArgoCD on your AKS cluster. Now you can deploy your applications with ease using GitOps principles.
Find all the resources used in this blog here:¶
All the codes used:
Manifest and terraform files:
References¶
Enjoyed this read?
If you found this guide helpful,check our blog archives 📚✨
Follow me on LinkedIn to get updated.
Read incredible Kubernetes Stories: Medium
Challenging projects: You’re already in the right place.
Until next time!