Cluster operationsLesson 16 of 16
Running a Fleet of Clusters
Sooner or later one cluster becomes several. Follow a small fleet as it grows: Git → Argo CD → clusters, a new cluster made by Cluster API, a Service shared across clusters, and the drift and version skew that a fleet collects over time.
Clusters2
Sync—
Cross-cluster name—
Versions1.34 · 1.34
RequestResponse / reportWatchAppears in a later step
What you will learn
- Why teams run several clusters instead of one big one
- One ApplicationSet that deploys to every matching cluster
- Creating clusters declaratively with Cluster API
- ServiceExport, ServiceImport and clusterset.local names
- Drift and version skew across a fleet, and how to catch them
Multi-cluster building blocks
| Need | Approach | Tool examples | Watch out for |
|---|---|---|---|
| Same apps on every cluster | GitOps with a per-cluster generator | Argo CD ApplicationSet, Flux | Per-cluster overrides that grow until every cluster is special |
| Create and upgrade clusters | Declarative cluster lifecycle | Cluster API, Terraform, managed services | Machine replacement during upgrades needs spare capacity and PodDisruptionBudgets |
| Find a Service in another cluster | Multi-Cluster Services API | GKE multi-cluster Services, Submariner | The same namespace name means the same owner in every cluster |
| Send users to a healthy cluster | Global load balancing | DNS with health checks, anycast load balancers | DNS TTLs delay failover |
| mTLS and failover between clusters | Multi-cluster mesh | Istio multi-primary, Linkerd multicluster, Cilium Cluster Mesh | A shared root CA and network reachability between clusters |
| Know what runs where | Fleet inventory | Argo CD cluster list, Cluster API status, cloud consoles | Version skew in Kubernetes and add-ons |
Try it yourself
kubectl config get-contexts # Which clusters this kubeconfig knows
argocd cluster list # Clusters registered with Argo CD
kubectl get secret -n argocd -l argocd.argoproj.io/secret-type=cluster --show-labels # Labels the generator selects on
kubectl get applicationset -n argocd # Fleet-wide app definitions
kubectl get applications -n argocd # One per cluster: SYNC STATUS and HEALTH
kubectl get clusters,machinedeployments -A # On the management cluster (Cluster API)
clusterctl describe cluster prod-c -n fleet # Control plane and machine readiness
clusterctl get kubeconfig prod-c -n fleet > prod-c.kubeconfig # Credentials for the new cluster
kubectl get serviceexport,serviceimport -n shop # Multi-Cluster Services objects
for ctx in prod-a prod-b prod-c; do # Version skew across the fleet
echo "$ctx $(kubectl --context "$ctx" version -o json | jq -r .serverVersion.gitVersion)"
done
Check yourself
Further reading: Cluster API book · Argo CD cluster generator · Multi-Cluster Services API (KEP-1645) · SIG Multicluster · Istio multicluster installation · Kubernetes version skew policy · Helm and GitOps · When a Whole Region Goes Down