CodeBlanks Logo Icon CodeBlanks

What is multi-cluster?

Learn the concept of managing multiple clusters.

What is multi-cluster?

Organizations often run several clusters instead of a single one. Reasons:

  • Isolation: development, test and production in separate clusters; the blast radius of a failure shrinks.
  • Availability: clusters in different regions; if one region fails, another serves.
  • Proximity and regulation: a region close to users, data staying in the country.
  • Scale: the node and object limits of a single cluster.
gelistirme   (minikube)       ─ developers
staging     (eu-central-1)   ─ tests
uretim-eu   (eu-central-1)   ─ European users
uretim-tr   (istanbul-dc)    ─ Turkish users, local data

The cost

Several clusters increase the operational load: each is upgraded, monitored and backed up separately; configurations must stay consistent. That's why with GitOps (Argo CD, Flux) the desired state of all clusters is managed from a single Git repository:

git repository
  clusters/
    uretim-eu/   -> Argo CD -> uretim-eu cluster
    uretim-tr/   -> Argo CD -> uretim-tr cluster
  uygulamalar/magaza/  (shared chart + environment-specific values)

Practice Move between clusters

Write three commands: list the contexts; list the nodes in the uretim-eu context (with --context uretim-eu, without switching); list the deployments in the magaza namespace in the uretim-tr context.

Starter code

terminal
# buraya yaz

Sample solution

terminal
kubectl config get-contexts
kubectl get nodes --context uretim-eu
kubectl get deploy -n magaza --context uretim-tr

Expected output

CURRENT   NAME         CLUSTER      AUTHINFO     NAMESPACE
*         minikube     minikube     minikube     default
          uretim-eu    uretim-eu    ali-eu
          uretim-tr    uretim-tr    ali-tr
NAME          STATUS   ROLES    AGE   VERSION
ip-10-0-1-5   Ready    <none>   40d   v1.31.2
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
api    4/4     4            4           12d
web    3/3     3            3           12d

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What is the most important benefit of keeping production in a separate cluster?

  • Less YAML
  • Faster pods
  • A bug or wrong command in the test environment can't affect production Correct answer
  • It's cheaper

Explanation: Namespaces share the same control plane; a separate cluster provides full isolation.

2 List all saved contexts.

Question
kubectl config ____
Answer
kubectl config get-contexts

Explanation: get-contexts shows all targets in the kubeconfig.

3 Match.

Term Meaning
isolation Environment separation
availability Resilience to region failure
regulation Location of data
GitOps Consistent configuration

All lessons in Expert