Bootstrap a kubeadm Control Plane and Join Workers

In progress Kubernetes Networking

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_forward is 1, /proc/swaps lists no device, findmnt -no OPTIONS / shows rw.
  • 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: kubectl and helm.
  • My homelab: k8s-cp-01 (Dell E7440, NIC eno1) as the first control plane, k8s-gpu-01 (ROG, GTX 1070) as a tainted GPU worker, VIP 192.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

  1. 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)
    
  2. 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 once init has finished (see A Highly Available Control Plane Needs a Virtual IP That No Single Node Owns).
    sudo ip addr add "$VIP/32" dev "$IFACE"
    
  3. Initialise against the VIP, without kube-proxy and without a pod CIDR (Cilium allocates pod IPs itself):
    sudo kubeadm init --control-plane-endpoint "$VIP:6443" --upload-certs \
      --skip-phases=addon/kube-proxy
    
    Keep the two printed kubeadm join commands. The token lasts 24 h; the certificate key for new control planes, 2 h.
  4. Start kube-vip as a static pod, now that RBAC exists. ctr run doesn't pull images, and kubelet's images live in the k8s.io namespace:
    sudo 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
    
    No --services: LoadBalancer IPs are left to Cilium, so two speakers don't answer ARP for the same addresses.
  5. 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
    
  6. (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-
    
  7. 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

  1. Install Cilium from the workstation. With no kube-proxy, nothing serves the kubernetes Service yet, so Cilium must be given the API address:
    helm 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=5m
    
    The node turns Ready, and CoreDNS gets pod IPs (10.0.x.x with Cilium's default cluster pool).

Workers

  1. On each worker, run the worker join command (without --control-plane) as root. Lost or expired: kubeadm token create --print-join-command on a control plane.
  2. Taint and label. A GPU node is tainted so only pods that ask for it run there; a role label lets workloads select it:
    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
    
    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).
  3. Delete the token once every node has joined: sudo kubeadm token delete <token-id>.

More Control Planes Later

  1. 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.service if 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 wide lists every node Ready, and the API answers through the VIP (kubectl cluster-info shows https://<VIP>:6443).
  • kubectl -n kube-system get pods -o wide: kube-vip-*, cilium-*, cilium-envoy-*, cilium-operator-* and both coredns-* 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=Never reaches Running with a pod IP, then kubectl delete pod test.
  • kubeadm token list is 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.conf isn't read (see Runtime Kernel Changes Last Until Reboot Unless Written to Their Configuration Directory).
  • Preflight error about missing conntrack or ethtool: 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.8 vs the one kubeadm expects): set sandbox_image in the containerd config, drop-ins included.
  • the bootstrap token is invalid on join: the CA hash (sha256:...) was passed to --token. Regenerate the whole command with kubeadm token create --print-join-command rather than assembling it by hand.
  • Node Ready but CoreDNS stuck in ContainerCreating after installing Cilium: containerd can't find cilium-cni; fix bin_dir (see containerd Looks for CNI Plugins in One Directory, So a Path Mismatch Blocks Pod Networking).
  • A cilium-operator pod Pending: the default two replicas need two schedulable nodes; use operator.replicas=1 meanwhile.
  • kubectl/helm try localhost:8080: no kubeconfig in this shell; export KUBECONFIG=... or copy it to ~/.kube/config.

References