Starting point#
This guide starts after the Ubuntu 26.04 Server installation guide. At this point the server should boot cleanly, have SSH access available, and use a storage layout that leaves enough room for Kubernetes runtime data under /var.
Use this guide first if the server operating system is not installed yet.
Do not install Kubernetes packages before the node passes basic operating system, hostname, kernel, and container runtime checks.
Kubernetes node preparation rule
Swap and system updates#
Start by checking swap. Kubernetes expects swap to be disabled unless the cluster is explicitly configured for swap-aware behavior. For a standard kubeadm-style setup, this command should print nothing.
Update package metadata and apply available upgrades before adding Kubernetes or container runtime repositories. This reduces avoidable package conflicts later.
Base utilities#
Install a small base toolset for downloading repositories, editing configuration, inspecting the node, and troubleshooting networking during cluster setup.
Hardware checks#
Before changing kernel and container runtime configuration, confirm that the node has the expected CPU capabilities, memory, and CPU topology. These checks are especially useful when the node is a virtual machine.
Virtualization support#
A value greater than 0 means CPU virtualization flags are exposed to the operating system. This matters when the Kubernetes node itself will run nested virtualization workloads or when you are validating VM host settings.
Memory and CPU#
Hostname configuration#
Use a stable hostname before joining the node to a cluster. Renaming a node after Kubernetes components are installed is possible, but it creates unnecessary cleanup work.
Check hostname#
Change hostname if needed#
Add hostname to /etc/hosts#
Kernel modules for Kubernetes#
Kubernetes networking relies on Linux bridge filtering and overlay support. Configure the required modules so they load on boot, then load them immediately for the current session.
Checks#
sysctl for Kubernetes#
Enable bridge packet visibility for iptables and IPv4 forwarding. Without these settings, pod networking and service routing can fail in ways that are hard to diagnose later.
Check IPv4 forwarding#
Docker repository and containerd#
containerd is the container runtime used by the Kubernetes node. Add Docker's Ubuntu repository first, then install the packaged containerd runtime from that repository.
Add Docker repository#
Install containerd#
containerd SystemdCgroup#
Configure containerd to use systemd cgroups for the Kubernetes runtime. This keeps the kubelet and container runtime aligned with the cgroup manager used by the operating system.
Restart and check containerd#
At this point the node has the base operating system checks, kernel networking settings, and container runtime configuration needed before adding the Kubernetes package repository.
Kubernetes v1.36 packages#
This article targets Kubernetes v1.36. Keeping the repository URL, installed tools, and held package versions aligned around one Kubernetes minor version makes the setup easier to reproduce and prevents accidental upgrades while the cluster is being configured.
Add kubernetes keyring#
Add Kubernetes repository#
Install Kubernetes tools#
Install kubelet, kubeadm, and kubectl together. kubelet runs on the node, kubeadm bootstraps the cluster, and kubectl is the command-line client used to inspect and manage the cluster.
Hold package versions#
Hold the Kubernetes packages after installation. Cluster upgrades should be planned and executed deliberately, not pulled in by a normal system upgrade.
Check the installed tools#
Pull Kubernetes images#
Before initializing the control plane, pull the Kubernetes images that kubeadm needs. This is a useful checkpoint because image pull problems are easier to diagnose before kubeadm starts writing cluster state.
Initialize the control plane#
Initialize the first control-plane node with kubeadm. The pod CIDR below is commonly used with Flannel. If a different CNI plugin will be installed later, use the pod network CIDR required by that plugin instead.
A successful initialization prints a clear confirmation message near the end of the output.
Keep the kubeadm output. It contains the kubeconfig setup commands and, later, the join command for worker nodes.
kubeadm initialization note
Configure kubectl access#
After kubeadm finishes, configure kubectl for the current user. kubeadm prints these commands in the output; the standard local-admin setup usually looks like this.
First cluster check#
Check the node after configuring kubectl. At this stage the control-plane node usually appears, but it is not ready yet because a pod network add-on has not been installed.
The NotReady status is normal here. The next article installs Cilium as the CNI, verifies that the node becomes Ready, and adds the first cluster checks.
Install the Cilium CLI, Gateway API CRDs, Cilium networking, single-node scheduling, a test workload, and metrics-server.