Bootstrap a kubeadm Control Plane and Join Workers
Goal
A bare-metal cluster whose API sits behind a virtual IP from day one, with Cilium as the pod network and kube-proxy replacement, and workers joined, tainted and labelled. It starts with one control plane; more join later without new certificates.
Rewritten in November 2026 for the homelab v2 (the v1 version used Flannel, kube-proxy and the control plane's own IP).
Prerequisites
- Every node prepared (see Prepare a Debian Node for Kubernetes), and checked after a reboot:
cat /proc/sys/net/ipv4/ip_forwardis1,/proc/swapslists no device,findmnt -no OPTIONS /showsrw. - containerd looks for CNI plugins in
/opt/cni/bin, in the merged config:sudo containerd config dump | grep bin_dir(see containerd Looks for CNI Plugins in One Directory, So a Path Mismatch Blocks Pod Networking). - A free LAN address for the API virtual IP, outside the DHCP range, and the name of the NIC that will carry it.
- On the workstation:
kubectlandhelm. - My homelab:
k8s-cp-01(Dell E7440, NICeno1) as the first control plane,k8s-gpu-01(ROG, GTX 1070) as a tainted GPU worker, VIP192.168.1.50.
VIP=192.168.1.50
IFACE=eno1
CILIUM_VERSION=1.20.5 # tested with Kubernetes 1.33-1.36 (last checked 2026-11); check again before use
KVVERSION=v0.8.0
Steps
Control Plane
- Reused machine? Clear the old cluster first, or preflight fails and an old CNI config is picked up:
sudo kubeadm reset -f sudo find /etc/cni/net.d -mindepth 1 -delete # not `sudo rm -rf /etc/cni/net.d/*` (the glob expands as your user) - Bind the VIP by hand. kubeadm talks to the API through the VIP during
init, but kube-vip can't take it yet: its RBAC rules only exist onceinithas finished (see A Highly Available Control Plane Needs a Virtual IP That No Single Node Owns).sudo ip addr add "$VIP/32" dev "$IFACE" - Initialise against the VIP, without kube-proxy and without a pod CIDR (Cilium allocates pod IPs itself):
Keep the two printedsudo kubeadm init --control-plane-endpoint "$VIP:6443" --upload-certs \ --skip-phases=addon/kube-proxykubeadm joincommands. The token lasts 24 h; the certificate key for new control planes, 2 h. - Start kube-vip as a static pod, now that RBAC exists.
ctr rundoesn't pull images, and kubelet's images live in thek8s.ionamespace:
Nosudo ctr -n k8s.io image pull "ghcr.io/kube-vip/kube-vip:$KVVERSION" sudo ctr -n k8s.io run --rm --net-host "ghcr.io/kube-vip/kube-vip:$KVVERSION" kv /kube-vip \ manifest pod --interface "$IFACE" --address "$VIP" --controlplane --arp --leaderElection \ | sudo tee /etc/kubernetes/manifests/kube-vip.yaml >/dev/null--services: LoadBalancer IPs are left to Cilium, so two speakers don't answer ARP for the same addresses. - Kubeconfig for your user, then on the workstation (it holds cluster-admin credentials: keep it out of Git):
mkdir -p ~/.kube && sudo install -o "$USER" -g "$USER" -m 600 /etc/kubernetes/admin.conf ~/.kube/config scp <user>@<control-plane>:~/.kube/config ./kubeconfig && export KUBECONFIG=$PWD/kubeconfig - (Single control plane) Allow ordinary pods on it, or nothing but tolerating pods can run:
kubectl taint nodes <control-plane-node> node-role.kubernetes.io/control-plane- - Reboot the control plane once before any other control plane joins: the hand-added VIP disappears and kube-vip owns it from then on. Otherwise the first node keeps answering for the VIP after kube-vip moves it.
Pod Network: Cilium
- Install Cilium from the workstation. With no kube-proxy, nothing serves the
kubernetesService yet, so Cilium must be given the API address:
The node turnshelm repo add cilium https://helm.cilium.io && helm repo update helm install cilium cilium/cilium --version "$CILIUM_VERSION" --namespace kube-system \ --set kubeProxyReplacement=true \ --set k8sServiceHost="$VIP" --set k8sServicePort=6443 \ --set operator.replicas=1 # 2 once two nodes are schedulable kubectl -n kube-system rollout status ds/cilium --timeout=5mReady, and CoreDNS gets pod IPs (10.0.x.xwith Cilium's default cluster pool).
Workers
- On each worker, run the worker join command (without
--control-plane) as root. Lost or expired:kubeadm token create --print-join-commandon a control plane. - Taint and label. A GPU node is tainted so only pods that ask for it run there; a role label lets workloads select it:
A pod needs both a toleration and a nodeSelector to end up there (see A Toleration Lets a Pod onto a Tainted Node, It Doesn't Send It There).kubectl taint node k8s-gpu-01 nvidia.com/gpu=true:NoSchedule --overwrite kubectl label node k8s-gpu-01 node-role.kubernetes.io/gpu= homelab/gpu=nvidia --overwrite - Delete the token once every node has joined:
sudo kubeadm token delete <token-id>.
More Control Planes Later
- On an existing control plane, create a certificate key and a join command, then join the new node with
--control-plane --certificate-key <key>and give it its own kube-vip manifest (its own NIC name). Join the second and third on the same day, after an etcd snapshot (see Two etcd Members Tolerate No More Failures Than One, So Go from One Control Plane to Three;sudo systemctl start etcd-backup.serviceif backups are set up as in Back Up and Restore etcd on a kubeadm Cluster):sudo kubeadm init phase upload-certs --upload-certs sudo kubeadm token create --print-join-command
Verify
-
kubectl get nodes -o widelists every nodeReady, and the API answers through the VIP (kubectl cluster-infoshowshttps://<VIP>:6443). -
kubectl -n kube-system get pods -o wide:kube-vip-*,cilium-*,cilium-envoy-*,cilium-operator-*and bothcoredns-*Running. -
kubectl get nodes -o custom-columns=NODE:.metadata.name,TAINTS:.spec.taints[*].key: only the GPU node is tainted. -
kubectl run test --image=nginx --restart=NeverreachesRunningwith a pod IP, thenkubectl delete pod test. -
kubeadm token listis empty.
Troubleshooting
- Preflight:
/proc/sys/net/ipv4/ip_forward contents are not set to 1: the sysctl didn't survive a reboot; on Debian 13/etc/sysctl.confisn't read (see Runtime Kernel Changes Last Until Reboot Unless Written to Their Configuration Directory). - Preflight error about missing
conntrackorethtool:sudo apt install -y conntrack ethtool, then rerun. - Warning
RuntimeConfig ... not implemented: containerd 1.7 lacks that CRI method. Harmless up to Kubernetes 1.36; upgrade containerd before 1.37. - Warning about the sandbox image (
pause:3.8vs the one kubeadm expects): setsandbox_imagein the containerd config, drop-ins included. the bootstrap token is invalidon join: the CA hash (sha256:...) was passed to--token. Regenerate the whole command withkubeadm token create --print-join-commandrather than assembling it by hand.- Node
Readybut CoreDNS stuck inContainerCreatingafter installing Cilium: containerd can't findcilium-cni; fixbin_dir(see containerd Looks for CNI Plugins in One Directory, So a Path Mismatch Blocks Pod Networking). - A
cilium-operatorpodPending: the default two replicas need two schedulable nodes; useoperator.replicas=1meanwhile. kubectl/helmtrylocalhost:8080: no kubeconfig in this shell;export KUBECONFIG=...or copy it to~/.kube/config.
References
- Kubernetes documentation: Creating a cluster with kubeadm - init, kubeconfig, network add-on, join.
- Kubernetes documentation: Creating Highly Available Clusters with kubeadm -
--control-plane-endpoint,--upload-certs, joining control planes. - kubeadm token reference -
--print-join-commandand token lifetime. - kube-vip documentation: static pods - generating the manifest; the homelab pins v0.8.0, newer releases exist (last checked 2026-11).
- Cilium documentation: Kubernetes without kube-proxy -
kubeProxyReplacement,k8sServiceHost. - Cilium documentation: Kubernetes compatibility - tested Kubernetes versions; 1.33 to 1.36 for the current release (last checked 2026-11).
- kubectl Cheat Sheet - commands for day-to-day use.
- Kubernetes MOC - hub for Kubernetes notes.