Kubernetes Home Lab Setup [Step-by-Step] – Part 1

Setting up a Kubernetes home lab is one of the best ways to learn container orchestration, cluster administration, and modern cloud-native infrastructure in a hands-on environment. In this step-by-step guide, I will show you how to build a Kubernetes home lab on Ubuntu Server using Ubuntu 24.04 LTS (Noble Numbat) installed from scratch on VMware Workstation.

The lab will include one control-plane node and multiple worker nodes, created using kubeadm for cluster bootstrapping, containerd as the container runtime, and Calico as the Container Network Interface (CNI) to provide pod networking and network policy support. The diagram below shows the Kubernetes home lab architecture that I will be provisioning.

If you prefer to use different add-on components for your Kubernetes cluster, you can install those instead. For example, if you want to use Flannel or Canal as your CNI plugin, skip the steps to install Calico CNI in this post. Follow the installation guidance on the Kubernetes.io website for the CNI plugin you will be installing.

Let’s get started!!

Step 1: Download Ubuntu 24.04 (Noble Numbat)

The first step is to download Ubuntu 24.04 LTS (Noble Numbat) from here: Ubuntu 24.04.4 (Noble Numbat). I will be downloading the server installation image rather than the desktop image, as I do not require a GUI. This also reduces the need for additional RAM and CPU resources compared to a GUI-based Ubuntu Server installation.

Download Ubuntu 24.04

You can also choose Ubuntu 26.04 LTS, which is currently the latest version. However, I did not have much success with this version in my lab and encountered the errors below while initializing the cluster using kubeadm. In contrast, I was able to successfully initialize the cluster using kubeadm on Ubuntu 24.04.

The following packages have unmet dependencies:

  • kubeadm : Depends: cri-tools (>= 1.30.0) but it is not installable
  • kubelet : Depends: kubernetes-cni (>= 1.2.0) but it is not going to be installed
  • E: Unable to satisfy dependencies. Reached two conflicting assignments:
    • 1. kubeadm:amd64=1.36.0-1.1 is selected for install
    • 2. kubeadm:amd64 Depends cri-tools (>= 1.30.0) but none of the choices are installable: [no choices]

Step 2: Install Ubuntu 24.04 (Noble Numbat)

As per my home lab architecture, I will create one control plane node and two worker nodes. Therefore, I will create three virtual machines as per the below specifications.

RoleHostnamevCPURAMDiskIP
Control planeKube-Master0122 GB20 GB192.168.55.61
Worker 1Kube-node0122 GB20 GB192.168.55.193
Worker 2Kube-node0222 GB20 GB192.168.55.72

The installation of Ubuntu Server is straightforward, and I used the default selections throughout the process. I will demonstrate the installation on one VM, and the same steps apply to the other two servers running Ubuntu 24.04. Let’s take a look.

Steps to Install Ubuntu 24.04 Server

  • The steps below cover the installation of Ubuntu 24.04 Server. Create a virtual machine using VMware Workstation or Oracle VirtualBox and start the VM. The OS will boot and present the installation screens. On the first screen shown below, select Try or Install Ubuntu Server and press Enter to continue.
Steps to Install Ubuntu 24.04 Server
  • Select the OS language. By default, English will be selected. Press Enter to proceed to the next step.
Steps to Install Ubuntu 24.04 Server
  • Select Update to the new installer and press Enter. This is optional; you can also go with the continue without updating option as well.
Steps to Install Ubuntu 24.04 Server
  • Review the keyboard configuration and select Done.
Steps to Install Ubuntu 24.04 Server
  • Choose the type of installation. I will go with Ubuntu Server; select Done.
Steps to Install Ubuntu 24.04 Server
  • Ubuntu archive mirror configuration: Select Done and press Enter to proceed to the next step.
Steps to Install Ubuntu 24.04 Server
  • Guided storage configuration: Select Done and press Enter to proceed to the next step.
Steps to Install Ubuntu 24.04 Server
  • Storage configuration: Select Done and press Enter to proceed to the next step.
Steps to Install Ubuntu 24.04 Server
  • Storage configuration: Select Continue.
Steps to Install Ubuntu 24.04 Server
  • Profile configuration: Provide the information in the form that you will use to connect to the server.
    • Your name: Provide your name
    • Your servers name: Provide the name of the server. For example, kube-master01 or kube-node01.
    • Pick a username: Provide a username.
    • Choose a password: Provide the password.
    • Confirm your password: Confirm the password.

Select Done and press Enter to create the user profile.

Steps to Install Ubuntu 24.04 Server
  • Upgrade to Ubuntu Pro: For this home lab, Ubuntu Pro is not required. Keep the default option Skip for now selected, and then choose Continue.
Steps to Install Ubuntu 24.04 Server
  • SSH configuration: Do not select Install OpenSSH server for now. We will install it later. Select Done and press Enter to proceed to the next step.
Steps to Install Ubuntu 24.04 Server
  • Features server snaps: Do not select any applications. Select Done and press Enter to proceed to the next step.
Steps to Install Ubuntu 24.04 Server
  • The installation will start and may take a few minutes to complete. Once finished, the header will change to Installation complete, and you will see a Reboot Now option. Select it to reboot the server.
Steps to Install Ubuntu 24.04 Server
  • After you reboot the server, you may see an error:
[FAILED] Failed unmounting cdrom.mount - /cdrom. Please remove the installation medium then press ENTER:

To fix the error, open the VM Settings > Hardware tab > CD/DVD (SATA) > Device status > Uncheck Connect at power on option > Press OK button. Restart the VM.

Steps to Install Ubuntu 24.04 Server
  • After the reboot, the server will start and display the login prompt. Sign in using the user account you created during the installation process.
Steps to Install Ubuntu 24.04 Server
  • Check the server IP address using the IP add command.
Steps to Install Ubuntu 24.04 Server
  • Use the below commands to upgrade installed packages on the server.
sudo apt update
sudo apt upgrade -y
Steps to Install Ubuntu 24.04 Server
  • Repeat the steps to create three Ubuntu servers and note down their IP address information.
RoleHostnameIP
Control planeKube-Master01192.168.55.61
Worker 1Kube-node01192.168.55.193
Worker 2Kube-node02192.168.55.72
Kubernetes Home Lab on Vmware workstation

Creating a Kubernetes cluster requires running many commands, so it is much quicker if you can copy and paste them directly into the VM. However, VMware Workstation may not allow this. Therefore, we will first install OpenSSH on all the servers and connect to it remotely from the host machine.

Step 3: Install OpenSSH on all 3 Servers

In this step, we will install the OpenSSH server on all the servers, including the control plane server. Connect to each VM and run the commands given below:

Install OpenSSH Server

sudo apt update
sudo apt install openssh-server -y 

Check the status of SSH

Use the command below to check the status of SSH on the server. The status should show as enabled.

sudo systemctl status ssh

If SSH is not enabled, then you can use below commands to enable it:

sudo systemctl enable ssh
sudo systemctl start ssh 

If the firewall is enabled on the Ubuntu server, you may have to allow SSH on the firewall using below commands:

sudo ufw allow ssh
sudo ufw reload
sudo ufw status

Verify Remote SSH Connection

Connect using PuTTY or VS Code (Terminal), then run the command below to verify that SSH connectivity to all three nodes is working correctly.

ssh <userID>@<serverIP>

Example:
ssh [email protected]

To make it easier to work with all the servers, add them to the VS Code terminal and test the SSH connections.

Troubleshooting

The below error may occur when the SSH host key for the server has changed compared to the entry stored in your known_hosts file, which SSH flags as a potential security risk (possible man-in-the-middle attack or a rebuilt/reinstalled server). To fix it, remove the existing SSH host key entry for the server from your known_hosts file so a new key can be accepted.

PS C:\Users\jatin> ssh [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:67SDkPKHqomFFMRTaB6TrhVgKqBTsqgbYFD2dwy8pOw.
Please contact your system administrator.
Add correct host key in C:\Users\jatin/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\Users\jatin/.ssh/known_hosts:3
Host key for 192.168.55.61 has changed and you have requested strict checking.
Host key verification failed.

FIX:

ssh-keygen -R 192.168.55.61
ssh [email protected]
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY

Kubernetes Home Lab Series

References

Leave a Comment