This tutorial demonstrates how to install Kubernetes on Ubuntu 26.04 using kubeadm, the official cluster bootstrapping tool. Kubernetes is the industry-standard container orchestration platform that automates deployment, scaling, and management of containerized applications. By following this guide, you will set up a fully functional single-node Kubernetes cluster suitable for development, testing, and learning purposes.
Software Requirements and Linux Command Line Conventions
Category
Requirements, Conventions or Software Version Used
System
Ubuntu 26.04 Resolute Raccoon
Software
kubeadm, kubelet, kubectl, containerd
Other
Privileged access to your Linux system as root or via the sudo command. Minimum 2 GB RAM and 2 CPU cores recommended.
Conventions
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – requires given linux commands to be executed as a regular non-privileged user
Install Kubernetes on Ubuntu 26.04 by setting up containerd, adding the Kubernetes repository, installing kubeadm, and initializing the cluster.
Prerequisites for Kubernetes Install on Ubuntu 26.04
Before you install Kubernetes on Ubuntu 26.04, you must configure several system settings. Kubernetes requires swap to be disabled and specific kernel modules to be loaded for proper cluster operation.
Disable swap memory: Kubernetes requires swap to be disabled for the kubelet to function correctly
$ sudo swapoff -a
This disables swap immediately.
IMPORTANT
To make this permanent, edit /etc/fstab and comment out any line containing “swap” by adding a # at the beginning of that line. Without this step, swap will be re-enabled after reboot and Kubernetes will fail to start.
Load required kernel modules: Enable the overlay and br_netfilter modules needed for container networking
Kubernetes requires a container runtime to run containers. Ubuntu 26.04 includes containerd in its default repositories, which is the recommended runtime for Kubernetes deployments. Alternatively, you could install Podman and use it with Kubernetes through CRI-O, though containerd provides the most straightforward setup.
Install containerd: Install the container runtime from Ubuntu repositories
$ sudo apt update
$ sudo apt install containerd
Generate default configuration: Create the containerd configuration directory and generate a default config file
With the container runtime configured, you can now install the core Kubernetes components. The installation requires adding the official Kubernetes package repository to your system.
Install required packages: Install dependencies needed to add the Kubernetes repository
Hold packages: Prevent automatic upgrades that could break your cluster
$ sudo apt-mark hold kubelet kubeadm kubectl
Holding these packages ensures version consistency across your cluster and prevents unintended upgrades during system updates.
INSTALLATION TIPS
The Kubernetes version in the repository URL (v1.31) should match your intended cluster version. Check the official Kubernetes releases page for available versions.
Initialize the Kubernetes Cluster
Now you can initialize your Kubernetes cluster using kubeadm. This process creates the control plane components and configures the cluster for operation.
Initialize the cluster: Run kubeadm init with the pod network CIDR
The --pod-network-cidr flag specifies the IP address range for pod networking. The value 10.244.0.0/16 is compatible with Flannel, which we will install in the next section.
Configure kubectl for your user: Set up kubectl access for the current user
These commands copy the cluster admin configuration to your home directory and set proper ownership, allowing you to run kubectl commands without sudo.
By default, Kubernetes prevents workloads from running on control plane nodes. For a single-node development cluster, removing this taint allows pods to be scheduled on the only available node.
A pod network plugin is required for pods to communicate with each other across the cluster. Flannel is a simple and reliable choice that works well for most deployments.
Install Flannel: Apply the Flannel manifest to deploy the network plugin
After completing the installation, verify that all components are functioning correctly. A properly configured cluster should show all system pods in Running status and the node in Ready state.
Check node status: Verify the node is ready
$ kubectl get nodes
Output should show your node with STATUS “Ready”. If the status shows “NotReady”, wait a few moments for the network plugin to initialize.
Check system pods: Verify all Kubernetes system components are running
$ kubectl get pods -n kube-system
All pods should show Running or Completed status.
Deploy a test application: Create a test pod to verify the cluster accepts workloads
$ kubectl run nginx --image=nginx --port=80
$ kubectl get pods
The nginx pod should transition to Running status within a minute, confirming that your cluster can pull images and schedule pods.
COMPLETED
Your Kubernetes cluster is now installed and operational on Ubuntu 26.04. You can begin deploying containerized applications using kubectl or Helm charts.
If you plan to work with containerized applications outside of Kubernetes, you may also want to learn how to use Podman containers for local development and testing.
Conclusion
You have successfully completed the Kubernetes install on Ubuntu 26.04 using kubeadm. Your single-node cluster includes all the essential components: a container runtime (containerd), the control plane services, and a pod network (Flannel). This setup is ideal for learning Kubernetes concepts, developing applications, and testing deployments before moving to production environments. To expand your cluster, you can use the kubeadm join command on additional nodes with the token generated during initialization.
Frequently Asked Questions
Why does Kubernetes require swap to be disabled? Kubernetes schedules pods based on available memory resources. When swap is enabled, the kubelet cannot accurately determine memory usage, which can lead to unpredictable behavior and performance issues. The Kubernetes project requires swap to be disabled to ensure consistent and reliable resource management across the cluster.
Can I use Docker instead of containerd as the container runtime? While Docker was previously supported, Kubernetes deprecated dockershim in version 1.24. You can still use Docker Engine with Kubernetes through the cri-dockerd adapter, but containerd is the recommended and simpler option. Containerd is the underlying runtime that Docker itself uses, so there is no practical disadvantage to using it directly.
How do I add worker nodes to my cluster? During cluster initialization, kubeadm outputs a join command with a token. Run this command on each worker node to join it to the cluster. If you did not save the command, generate a new token using kubeadm token create --print-join-command on the control plane node.
What should I do if pods remain in Pending status? Pending status typically indicates a scheduling issue. On a single-node cluster, ensure you removed the control plane taint. Also verify that the node has sufficient CPU and memory resources. Run kubectl describe pod <pod-name> to see detailed scheduling failure reasons.
How do I upgrade Kubernetes to a newer version? Use kubeadm to upgrade the cluster in stages. First, upgrade kubeadm itself, then run kubeadm upgrade plan to see available versions, and kubeadm upgrade apply <version> to perform the upgrade. After upgrading the control plane, upgrade kubelet and kubectl on each node.