multi-cluster-argo-demo
multi-cluster-argo-demo copied to clipboard
Anthos-inspired experiment using Argo CD for multi-cluster config management
Argo CD Multi-Cluster Demo
Inspired by Google Anthos Configuration Manager (ACM) I wondered if I could use Argo CD and a repository to auto-configure multiple Kubernetes clusters. This repo is my sandbox for testing this theory and playing with different features.
Architecture
The objective is to connect multiple kubernetes clusters via Argo CD to this repo and whenever I push changes in this repo, they will automatically apply the changes.

Usage
- Create or use an existing Google Cloud Platform project (demo purposes but any clusters should work)
- Clone this repository to your computer, cd to
multi-cluster-argo-demo - Create a
.envfile in the same directory ascreate-k8s-clusters.sh
cat > .env << EOF
export PROJECT_ID=<YOUR PROJECT ID>
export AUTH_NETWORK="<YOUR IP ADDRESS>/32"
EOF
- Execute the bootstrap script
./create-k8s-clusters.sh - Log into your clusters after 8-10 minutes and confirm you have
eastandwestclusters and Argo CD workloads are installed.

- Port forward requests to Argo CD server and fetch default password (server pod name)
# port forward (for now) to access argocd UI
kubectl port-forward svc/argocd-server -n argocd 8080:443 &
# fetch initial password (auto generated)
export ARGO_PASS=$(kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2)
echo "Argo default pass: ${ARGO_PASS}"
- Open browser to
http://localhost:8080(accept security warning) and useadminand<PASSWORD FROM ABOVE>to confirm applications synced
- Confirm your clusters have the
namespace,serviceaccount,role,rolebindingdeclared in thek8s-config/folder
- Create your own repo and change the
app-of-apps.yamlandk8s-config.yamlto point to your repo instead. - Enjoy!
Cleanup
If you are just trying this out, then to avoid unnecessary expense either delete your project or remove the recently-created clusters using the commands below:
gcloud container clusters delete west --zone us-west2-b
gcloud container clusters delete east --zone us-east1-c
Video Demo
If you want to see this demo in action, view the YouTube video below

Potential next steps
- read about private repositories
- use Argo CD
projects - use recursive directories
- add application workloads as well as cluster config