06

Multi-Node Cluster Setup with Kind

Video: Day 6/40 — Kubernetes Multi Node Cluster Setup Step By Step | Kind • https://www.youtube.com/watch?v=RORhczcOrWs • Duration: ~27 min

Key terms

TermMeaning
KindKubernetes IN Docker — runs cluster nodes as containers
Node (kind)A Docker container acting as a cluster node
Cluster configYAML defining node roles and count
Control-plane nodeNode running the control plane
ContextWhich cluster/user kubectl currently talks to
kubeconfigFile holding cluster access details

Problem & solution

Learning and testing multi-node behavior needs a cluster, but real multi-machine clusters are expensive and slow to provision. We need a cheap, fast, throwaway multi-node cluster that runs entirely on a laptop.

Solution: Run a real multi-node cluster locally with kind (each node is a Docker container) to learn and test without cloud cost.

The analogy

Instead of leasing real waterfront and pouring concrete, you build a working model port on your desk: tiny docks and a control office made of toy blocks that genuinely move cargo. kind does exactly that, standing up a real multi-node cluster on your laptop where every node is just a Docker container. The model harbor master's office is the control-plane node, the toy model docks are the worker nodes, and the desk and power strip holding it all up are the Docker engine that hosts every piece.

Where this fits in the cluster

The same cluster entities appear in every day's notes; the diagram below shows where this day's topic fits.

Graph legend — each node maps to a piece of the kind cka cluster:

Graph nodeMaps toWhat it does
api-serverkube-apiserver in the cka-control-plane containerFront door for the kind cluster
etcdetcd on the control-plane nodeStores cluster state
schedulerkube-schedulerAssigns pods to the worker containers
controller-managerkube-controller-managerRuns reconcile loops
Worker Nodecka-worker / cka-worker2 Docker containersRun the pods
Pod / container - nginx:1.27a workload podThe app you deploy to the kind cluster

What is Kind?

Kind = Kubernetes IN Docker. It runs each Kubernetes "node" as a Docker container. Perfect for local learning/CI — a full multi-node cluster on a laptop.

Graph legend — each node maps to a container created by the cka kind config:

Graph nodeMaps toWhat it does
Docker Engine - kind cluster ckathe host Docker daemonHosts every node as a container
container - cka-control-planerole: control-plane in kind-config.yamlRuns the control plane
container - cka-workerfirst role: workerRuns application pods
container - cka-worker2second role: workerRuns application pods

Install (macOS/Linux)

You need three tools: kind to build the cluster, kubectl to talk to it, and a running Docker engine to host the node containers.

# kind
brew install kind          # or: go install / curl binary
# kubectl
brew install kubectl
docker --version           # Docker must be running

Create a cluster config (multi-node)

A small YAML file declares how many nodes you want and their roles (one control-plane, two workers here).

kind-config.yaml:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker

Spin it up

One command reads the config and boots the cluster; kind then wires up your kubectl context automatically.

kind create cluster --name cka --config kind-config.yaml

# kind auto-configures kubectl context to this cluster
kubectl cluster-info --context kind-cka
kubectl get nodes

Expected:

NAME                 STATUS   ROLES           AGE   VERSION
cka-control-plane    Ready    control-plane   1m    v1.xx
cka-worker           Ready    <none>          1m    v1.xx
cka-worker2          Ready    <none>          1m    v1.xx

kubectl context (which cluster am I talking to?)

A context binds kubectl to a specific cluster, user, and namespace — switch contexts to point commands at a different cluster.

kubectl config get-contexts
kubectl config current-context
kubectl config use-context kind-cka

Graph legend — each node maps to the kind-cka context wiring:

Graph nodeMaps toWhat it does
kubectlthe kubectl clientRuns commands against whatever context is active
context kind-ckakubectl config use-context kind-ckaSelects the cka cluster, user, and namespace
cka-control-plane API server + credsthe kind cluster's apiserver endpointReceives the authenticated requests
kubeconfig file holds them~/.kube/configStores cluster endpoints and credentials kind wrote

Useful kind ops

Everyday housekeeping commands for listing, deleting, and peeking at the node containers.

kind get clusters            # list clusters
kind delete cluster --name cka
docker ps                    # see the node containers

Pin a Kubernetes version (handy for CKA practice)

Pass a specific node image to lock the cluster to the Kubernetes version you want to practise against.

kind create cluster --name cka \
  --image kindest/node:v1.30.0 --config kind-config.yaml

End-to-end flow

One config file to a ready multi-node cluster: kind boots node containers, bootstraps Kubernetes, and wires up your context.

Graph legend — each node maps to a step from config to a ready cka cluster:

Graph nodeMaps toWhat it does
kind create cluster --name ckathe create commandKicks off cluster creation from the config
kind reads node configkind-config.yaml (1 control-plane + 2 workers)Declares node count and roles
Docker creates node containersthe Docker daemonLaunches one container per node
cka-control-plane nodethe role: control-plane containerHosts the control plane
cka-worker / cka-worker2the role: worker containersHost the workloads
Bootstrap Kubernetes (kubeadm)kind's internal kubeadmInitializes and joins the nodes
Write kubeconfig context kind-ckathe kind-cka contextPoints kubectl at the new cluster
kubectl get nodes Readythe verification commandConfirms all three nodes are Ready

Key takeaways

  • Kind nodes are Docker containers, not VMs — fast and disposable.
  • One config file defines control-plane + worker roles.
  • kubectl talks to the cluster via the context in your kubeconfig.

Checklist

  • [ ] Installed kind + kubectl, Docker running
  • [ ] Created a 3-node cluster from config
  • [ ] kubectl get nodes shows control-plane + 2 workers Ready
  • [ ] Switched contexts and deleted a cluster