Room 50
MULTI-CLUSTER KIND
The Federated Realms
- Real-world Kubernetes often means multiple clusters - dev, staging, prod.
- Kind lets you run several clusters simultaneously for multi-cluster experiments.
📜 Mission Briefing
- Create two Kind clusters:
cluster-eastandcluster-west. - Configure
kubectlcontexts for both clusters. - Deploy an app in
cluster-eastand a database incluster-west. - Switch between contexts seamlessly.
- The combined node count across both clusters reveals the password:
multiclr.
Key Commands
| Command | Purpose |
|---|---|
kind get clusters |
List all Kind clusters |
kind create cluster --name east |
Create named cluster |
kubectl config get-contexts |
List all contexts |
kubectl config use-context kind-east |
Switch context |
kubectl config current-context |
Show active context |
Multi-Cluster with Kind
# Create multiple Kind clusters
kind create cluster --name cluster-east --config east-config.yaml
kind create cluster --name cluster-west --config west-config.yaml
# Kind automatically sets up kubeconfig contexts
# Context names: kind-cluster-east, kind-cluster-west
kubectl config get-contexts
# CURRENT NAME CLUSTER AUTHINFO
# * kind-cluster-east kind-cluster-east kind-cluster-east
# kind-cluster-west kind-cluster-west kind-cluster-west
# east-config.yaml: 2-node cluster
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
networking:
podSubnet: "10.244.0.0/16"
serviceSubnet: "10.96.0.0/12"
# west-config.yaml: 2-node cluster
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
networking:
podSubnet: "10.245.0.0/16"
serviceSubnet: "10.97.0.0/12"
# Working with multiple clusters
# Deploy app to east
kubectl --context kind-cluster-east apply -f app-deployment.yaml
kubectl --context kind-cluster-east get pods
# Deploy database to west
kubectl --context kind-cluster-west apply -f db-deployment.yaml
kubectl --context kind-cluster-west get pods
# Quick context switching
kubectl config use-context kind-cluster-east
kubectl get pods # Shows east pods
kubectl config use-context kind-cluster-west
kubectl get pods # Shows west pods
# Using kubectx for easier switching (if installed)
# kubectx kind-cluster-east
# kubectx kind-cluster-west
# Merge kubeconfigs
# KUBECONFIG=~/.kube/east:~/.kube/west kubectl config view --merge
# Cross-cluster service discovery patterns:
# 1. Submariner - connects pod/service networks across clusters
# 2. Istio multi-cluster - service mesh spanning clusters
# 3. KubeFed - federated resource placement
# 4. Liqo - virtual node multi-cluster resource sharing
# Cleanup
kind delete cluster --name cluster-east
kind delete cluster --name cluster-west
Hints
Hint 1
Hint 2
Hint 3
The password is multiclr.