Implementing Multi-Cluster Deployments

1. Understanding Multi-Cluster Patterns

PatternDetail
Hub-and-spokeCentral control plane (Argo CD, Flux) drives many clusters
FederatedEach cluster independent; same chart, env-specific values
Active-activeSame workload across regions with global LB
Active-passiveStandby cluster with replicas=0 until failover

2. Managing Kubeconfig Contexts

Example: Per-cluster commands

helm --kube-context prod-us-east upgrade api ./chart -f values-us-east.yaml
helm --kube-context prod-eu-west upgrade api ./chart -f values-eu-west.yaml
kubectl config get-contexts

3. Using Environment-Specific Values

Example: Layered values

helm upgrade api ./chart \
  -f values.yaml \
  -f values-prod.yaml \
  -f values-prod-us-east.yaml \
  --kube-context prod-us-east

4. Implementing GitOps Workflow

ToolApproach
Argo CDApplicationSet generates per-cluster Apps from cluster list
FluxHelmRelease + Kustomization per cluster
Rancher FleetBundle-based delivery to many clusters

5. Synchronizing Releases Across Clusters

Example: Argo CD ApplicationSet

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata: { name: api }
spec:
  generators:
    - clusters: {}
  template:
    metadata: { name: 'api-{{name}}' }
    spec:
      source:
        repoURL: https://github.com/acme/charts
        path: api
        helm:
          valueFiles: [values.yaml, 'values-{{name}}.yaml']
      destination: { server: '{{server}}', namespace: api }

6. Handling Cluster-Specific Configuration

ConcernSolution
DNS / IngressPer-cluster hostname value
Storage classOverride global.storageClass per cluster
Image registryRegional mirror via global.imageRegistry
Replica countSized per cluster capacity

7. Managing Cross-Cluster Dependencies

Cross-cluster needTool
Service discoverySubmariner / Istio multicluster / Cilium ClusterMesh
Secrets propagationExternal Secrets with central backend
Global LBExternal-dns + Route53 / Cloudflare

8. Implementing Blue-Green Deployments

Example: Two releases + traffic switch

helm upgrade --install api-blue  ./chart -f values.yaml --set color=blue
helm upgrade --install api-green ./chart -f values.yaml --set color=green
# Switch Service selector or Ingress
kubectl patch svc api -p '{"spec":{"selector":{"color":"green"}}}'

9. Managing Canary Releases

ApproachDetail
Two releasesStable + canary, weighted via Ingress / service mesh
Argo RolloutsRollout resource replaces Deployment with built-in canary
FlaggerAutomated progressive delivery with metric checks

10. Monitoring Multi-Cluster Deployments

LayerTool
Release statusArgo CD UI / flux get hr -A
Cluster federationPrometheus + Thanos / VictoriaMetrics cluster
LoggingLoki / Elastic with cluster label
TracingOpenTelemetry collector per cluster → central backend