Skip to main content
This lab walks through installing a simple Kubernetes cluster with kubeadm: installing kubeadm/kubelet/kubectl on both nodes, initializing the control-plane, joining a worker node, and deploying the Flannel pod network. Follow the steps in order and run the commands on the node(s) indicated.

Overview

  • Install and pin kubeadm, kubelet, and kubectl (v1.26.0 used in this lab).
  • Configure kernel networking and container runtime prerequisites.
  • Initialize the control-plane with kubeadm.
  • Join the worker node with the kubeadm join command.
  • Deploy Flannel for pod networking and validate node readiness.

Prerequisites (run on both control-plane and node01)

Recommended references:
If your distribution is older (for example Ubuntu < 22.04 or Debian < 12), the /etc/apt/keyrings directory may not exist. Create it before attempting to download the GPG key (see step 2).

1) Configure kernel networking settings (both nodes)

Enable bridge netfilter and allow IPv4 forwarding. Run this on both control-plane and node01:
You should see output similar to:
Notes:
  • Some sysctl keys may be reported as ignored depending on the environment; the key point is to enable the bridge netfilter and IP forwarding settings.

2) Add Kubernetes APT repository and install kubeadm, kubelet, kubectl (both nodes)

Update apt and install supporting packages, create /etc/apt/keyrings if necessary, add the Google Cloud GPG key, and add the Kubernetes apt source:
Install and pin the required Kubernetes packages (the lab uses v1.26.0):
Verify kubelet:
Expected:
Notes and troubleshooting:
  • You may see APT warnings about duplicate sources — this is non-fatal.
  • Some environments include policy scripts that prevent services from starting during package install (e.g., /usr/sbin/policy-rc.d returned 101). kubeadm will still configure kubelet appropriately.

3) Verify kubectl behavior before init (control-plane)

Before the control-plane is initialized, kubectl will not be able to reach the API server:
Expected error (this is normal prior to kubeadm init):

4) Initialize the control-plane with kubeadm (control-plane only)

  1. Find the IP address of the interface you will advertise (example uses eth0):
Example excerpt:
  1. Initialize the control-plane. Set --apiserver-advertise-address to the control-plane IP and set --pod-network-cidr to the CIDR required by your CNI (Flannel uses 10.244.0.0/16 in this lab):
Note: Always match --pod-network-cidr to the pod network plugin you plan to install.
  1. After kubeadm init completes, configure kubeconfig for your user:
As a regular user:
Or, if you prefer to stay root:
  1. Confirm the control-plane node is visible (it will initially be NotReady until the pod network is installed):
Example output shortly after init:
  1. Save the kubeadm join command that kubeadm init prints. Example:
Important: join tokens expire by default. If the token is expired when you try to join a node, create a new one on the control-plane:

5) Join node01 to the cluster (node01 only)

On node01, run the kubeadm join command copied from the control-plane output. Example:
Expected output snippet:
Then, on the control-plane, confirm the node joined:

6) Install Flannel pod network (control-plane)

Apply the Flannel manifest from the official Flannel releases. Run this on the control-plane where kubeconfig is configured:
This creates the required DaemonSets and supporting resources. Wait a short time for pods to be created, then check all pods:
Look for Flannel pods in the kube-system namespace in Running or Completed state. After the network is ready, nodes should transition to Ready:
Example final state:

7) Quick validation commands

  • List nodes:
  • List all pods across namespaces:
  • View kube-system resources (includes Flannel, kube-proxy, etc.):

Summary

  • Enabled required kernel networking settings and applied sysctl configuration.
  • Added Kubernetes APT repository and installed kubeadm, kubelet, and kubectl pinned at v1.26.0.
  • Initialized the control-plane with kubeadm init and configured kubeconfig.
  • Joined a worker node using the kubeadm join command.
  • Deployed the Flannel CNI manifest and validated nodes became Ready.
Further reading and references:

Watch Video