ArgoCD multi-cluster — one ArgoCD server manages multiple Kubernetes clusters.
Cluster registration:
1argocd cluster add production-context2argocd cluster add staging-context3argocd cluster list
Application to another cluster:
1apiVersion: argoproj.io/v1alpha12kind: Application3metadata:4 name: myapp-production5 namespace: argocd6spec:7 project: default8 source:9 repoURL: https://github.com/org/k8s-manifests10 targetRevision: main11 path: overlays/production12 destination:13 server: https://production-cluster.example.com14 namespace: production15 syncPolicy:16 automated:17 prune: true18 selfHeal: true
ApplicationSet (all clusters):
1apiVersion: argoproj.io/v1alpha12kind: ApplicationSet3metadata:4 name: myapp-all-clusters5spec:6 generators:7 - clusters:8 selector:9 matchLabels:10 environment: production11 template:12 metadata:13 name: "myapp-{{name}}"14 spec:15 source:16 repoURL: https://github.com/org/k8s-manifests17 path: overlays/production18 destination:19 server: "{{server}}"20 namespace: production21 syncPolicy:22 automated:23 prune: true24 selfHeal: true
Hub-and-Spoke: One central ArgoCD → multiple clusters.
ApplicationSet with Matrix (cluster × environment):
1generators:2 - matrix:3 generators:4 - clusters:5 selector:6 matchLabels:7 env: production8 - git:9 repoURL: https://github.com/org/apps10 revision: main11 directories:12 - path: apps/*
AppProject (restrictions):
1apiVersion: argoproj.io/v1alpha12kind: AppProject3metadata:4 name: team-orders5 namespace: argocd6spec:7 sourceRepos:8 - "https://github.com/org/k8s-manifests"9 destinations:10 - server: https://production-cluster.example.com11 namespace: "orders-*"12 - server: https://staging-cluster.example.com13 namespace: "orders-*"14 clusterResourceWhitelist: []15 namespaceResourceWhitelist: []
Security: RBAC for clusters, projects restrict deployments.