Four-Node kubeadm Cluster Setup
Build a control plane and three workers, then use the third worker to reach the placement features that need it: pod anti-affinity with somewhere to spread to, topology spread constraints, and a drain that leaves two healthy workers behind. Includes a spread constraint that silently refuses to schedule half your replicas, and why.
Installation and Cluster Builds Guide 10 of 103 Intermediate
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 55 min
Tokens, hashes, pod suffixes and timings differ on every run. Scheduler messages are quoted exactly as they appeared on this cluster.
- Kernel7.0.0-29-generic
- Calicov3.32.1
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when you need enough nodes to reach the placement features that require somewhere to place things. This matters because topology spread and anti-affinity both fail in instructive ways the moment there are more replicas than eligible nodes.
- preparing four machines identically and joining three workers to one control plane
- seeing the even spread you get for free, with no placement configuration at all
- writing a topology spread constraint that looks obviously correct, then finding why it stranded half the replicas - the control plane is a domain too
- using required pod anti-affinity and watching the fourth replica have nowhere to go
- draining a worker while two others are still standing
Before you start
- Four Ubuntu 26.04 machines, 2 CPUs and 2 GB of RAM minimum each, each with a unique hostname.
- All four on the same network; the three workers each reach the control plane on TCP 6443.
sudoand a fixed address on each.- A pod CIDR that does not overlap your LAN. This lab is 192.168.0.0/24 and uses 10.244.0.0/16.
- The two-node guide covers join mechanics and the three-node guide covers drain. This one assumes both and spends its time on placement.
-
Prepare all four machines identically
-
Install the packages on all four machines
-
Initialise the control plane and join all three workers
-
Install Calico
-
The default spread: even, with no configuration
-
A topology spread constraint that strands half your replicas
-
Why it stalled: the control plane is a topology domain
-
Pod anti-affinity: one per node, and the fourth has nowhere to go
-
Drain a worker with two others still standing
-
Clean up