๐ Multi-Cluster Deployment with GitOps (EKS + Argo CD)

This guide walks through setting up GitOps using Argo CD across multiple EKS clusters (1 Hub + 2 spokes), and managing them using Argo CD installed on the hub cluster.
Step 1 : Create EKS cluster
eksctl create cluster --name hub-cluster --region ap-south-1
eksctl create cluster --name spoke-cluster-1 --region ap-south-1
eksctl create cluster --name spoke-cluster-2 --region ap-south-1
verify in console
Step 2: Set kubectl Context to Hub Cluster
Step 3: Install Argo CD in Hub Cluster
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
verify all pods are up and running
Step 4: Enable Insecure Mode for Argo CD
Edit the argocd-cm
ConfigMap:
kubectl edit configmap argocd-cm -n argocd
Add:
server.insecure: "true"
Step 5: Change Argo CD Service Type to NodePort
Edit the service:
kubectl edit svc argocd-server -n argocd
Change:
type: ClusterIP
to:
type: NodePort
Note the NodePort (e.g., 32583
).
Step 6: Update Security Group Inbound Rules
Add inbound rules:
TCP 80 (HTTP)
TCP 32583 (Argo CD NodePort)
You should now be able to access Argo CD UI at:
http://<hub-cluster-node-ip>:32583
Step 7: Get Initial Admin Password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
๐ช On Windows PowerShell:
System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("<BASE64_PASSWORD>"))
Step 8: Install Argo CD CLI
Download from:
๐ https://argo-cd.readthedocs.io/en/stable/cli_installation/
Step 9: Login Using Argo CD CLI
argocd login <hub-cluster-node-ip>:32583 --username admin --password <decoded-password> --insecure
Step 10: Register Additional Clusters (Spoke Clusters)
Switch context to each spoke cluster and register:
bashCopyEditaws eks --region ap-south-1 update-kubeconfig --name spoke-cluster-1
argocd cluster add <context-name> --server <hub-cluster-ip>:32583 --insecure
aws eks --region ap-south-1 update-kubeconfig --name spoke-cluster-2
argocd cluster add <context-name> --server <hub-cluster-ip>:32583 --insecure
๐ Check in Argo CD UI under Settings > Clusters
Only in-cluster is shown by default โ new clusters will appear after this step.
Step 11: Create an Application in Argo CD
You can create an Argo CD Application from:
CLI
YAML
UI
Example CLI:
bashCopyEditargocd app create guestbook \
--repo https://github.com/argoproj/argocd-example-apps.git \
--path guestbook \
--dest-server https://<spoke-cluster-api-endpoint> \
--dest-namespace default \
--server <hub-cluster-ip>:32583
tep 12: Test GitOps Behavior
Make a Git Commit (e.g., replicas: 3)
Push the change. Argo CD will reconcile and apply it.
Try Manual Override:
kubectl scale deployment guestbook-ui --replicas=1
โ ๏ธ Replica count reverts back to 3.
This is because self-heal is enabled.
any manual changes you make (like scaling via kubectl) are quickly reverted by Argo CD to match the desired state defined in Git.
We'll update the replica count to 1 in the Git manifest. Once committed and pushed, Argo CD will pick up the change and reconcile the deployment by scaling down the replicas accordingly.
๐งน Cleanup
To delete all resources:
eksctl delete cluster --name hub-cluster --region ap-south-1
eksctl delete cluster --name spoke-cluster-1 --region ap-south-1
eksctl delete cluster --name spoke-cluster-2 --region ap-south-1
Also clean up:
Git repositories
EC2 security group rules
โ Conclusion
In this hands-on guide, we successfully implemented a multi-cluster GitOps setup using Argo CD across Amazon EKS clusters. By deploying Argo CD on a hub cluster and connecting multiple spoke clusters, we enabled centralized management of Kubernetes workloads via Git as the single source of truth. The power of Argo CD's self-healing and declarative deployment was clearly demonstrated โ any manual intervention was automatically reverted to match the Git state. This showcases the true potential of GitOps in production-grade environments.
This architecture lays a strong foundation for scalable, secure, and automated Kubernetes operations across multiple environments or teams.
Subscribe to my newsletter
Read articles from Abhijit Shenolikar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
