Kubernetes

Kubernetes Home Lab: Ultimate Guide for 2025!

Learn the best Kubernetes home lab setups and get hands-on experience with Microk8s, Minikube, k3s, and more.

Kubernetes can seem intimidating to get started with, but like any technology, the more you work with it and learn how it operates, the more confident youโ€™ll feel using it in production. One of the best ways to get comfortable with new technologies is by bringing them into your home lab. This allows you to explore and experiment without the risk of disrupting production environments. You can even treat these technologies as โ€œproductionโ€ in your home lab, learning how to manage and troubleshoot them when issues come up.

This guide will show you how to set up a Kubernetes cluster at home. Weโ€™ll explore a variety of Kubernetes solutions that are easy to get started with, such as Microk8s, Minikube, k3s, Docker Desktop Kubernetes, and Rancher Desktop. These are excellent options for building a Kubernetes home lab and sharpening your skills. Letโ€™s get started!

Why Build a Kubernetes Home Lab?

As mentioned earlier, building a Kubernetes home lab is an excellent way to develop your skills and get comfortable with the Kubernetes tech stack. A lab environment lets you test configurations, experiment with containerized applications, and explore Kubernetes without worrying about breaking anything critical. In short, it offers practical, hands-on experience.

Here are a few key use cases to take advantage of:

  • Running Containerized Applications – Kubernetes enables you to run containerized applications with high availability. In your home lab, you can also experiment with different deployment strategies like rolling updates and blue-green deployments.
  • CI/CD Pipelines – Your Kubernetes home lab is a great environment to explore working with CI/CD tools like Jenkins or GitLab CI. You can automate application deployment and testing, gaining valuable experience with these workflows.
  • Learning – Perhaps the most important use case is learning. Your Kubernetes home lab is perfect for exploring features, testing configurations, and experimenting with different scenarios to build your expertise in this highly sought after skill

5 Kubernetes Home Lab Distributions that make sense

Getting started with Kubernetes is easier than you might think, thanks to several greally good solutions that let you work with a Kubernetes cluster, even as a single-node setup. These options let you get into Kubernetes by giving you the option of setting up a single-node cluster.

Here are five excellent solutions to consider:

  1. Microk8s
  2. Minikube
  3. k3s
  4. Docker Desktop
  5. Rancher Desktop

1. Microk8s

If there is one solution that you can get up and running quickly and very easily, it is Microk8s. Microk8s is an extremely Kubernetes distribution from Canonical. Itโ€™s designed to run on resource-constrained devices. While this intent is to make it a great fit for edge Kubernetes clusters, you can use it for a lightweight Kubernetes homelab that doesnโ€™t require much at all. Also, Microk8s can be installed on a single node or you can use multiple nodes for the full Kubernetes cluster experience.

Installation Instructions:

You donโ€™t even have to spin up a full Linux virtual machine for a single-node installation. You can run it inside of Windows Subsystem for Linux (WSL). This makes it even simpler since you donโ€™t have the VM config to do, including cloud init, orsetting up an ssh server. You can launch your WSL terminal and install Microk8s using a simple snap command on your Linux machine.

Note the following command:

snap install microk8s --classic
Microk8s kubernetes home lab
Microk8s kubernetes home lab

One of the great features of Microk8s is it allows you to easily install add-ons to add functionality to the Kubernetes cluster. To list the addons that are currently enabled and also list the addons that you can enable in the Microk8s cluster, use the following command:

sudo microk8s status
Getting the status of the microk8s kubernetes home lab
Getting the status of the microk8s kubernetes home lab

By default it will enable required add-ons like DNS, ha-cluster, helm, helm3. You can easily enable other Microk8s add-ons with the command:

sudo microk8s enable <add on>
Enabling microk8s addon
Enabling microk8s addon

Learn more about Microk8s here: https://microk8s.io/.

2. Minikube

Minikube is another popular choice for setting up a Kubernetes cluster as a single node. It also supports many different virtualization technologies to allow you to spin up your single Kubernetes node. These include KVM, Hyper-V, Docker, etc.

Letโ€™s look at the steps to install Minikube in Ubuntu Linux. Make sure you have one of the virtualization technologies mentioned installed and ready to go before installing Minikube as this will be needed.

Installation Instructions:

The basic commands to install minikube are the following:

sudo apt install -y curl wget apt-transport-https && \
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && \
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Installing minikube
Installing minikube

Checking the version using the command:

minikube version
Minikube version for kubernetes home lab
Minikube version for kubernetes home lab

We also need to install kubectl as the command line that we will use to interact with our Kubernetes cluster. The commands to install kubectl are:

curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl

chmod +x kubectl
sudo mv kubectl /usr/local/bin/

Running through the steps to install kubectl.

Installing kubernetes home lab kubectl
Installing kubernetes home lab kubectl

Bringing up the minikube cluster using the Docker driver:

minikube start --driver=docker
Installing minikube with docker for kubernetes home lab
Installing minikube with docker for kubernetes home lab

Learn more about minikube here: https://microk8s.io/.

3. k3s

k3s is another lightweight Kubernetes distribution by Rancher Labs. It is an optimized Kubernetes distribution that can run on ARM architecture, x86, and IoT devices to name a few. Itโ€™s designed to be easy to install and manage. Even though it is meant for production networks, it is also a great distribution for home labs since it can run a single or multiple nodes and is installed with a single script.

Installation Instructions

As far as installation, you can install k3s using the following bash script. The script will pull down the installation and install k3s along with setting the service to start on boot.

curl -sfL https://get.k3s.io | sh -

You will need to copy the k3s.yaml file to a location you have access rights to for your user, such as your home directory.

sudo cp /etc/rancher/k3s/k3s.yaml ~

Then change ownership of the file:

sudo chown -R linuxadmin k3s.yaml

Then, you can set your environment variable to point to this file:

 export KUBECONFIG=~/k3s.yaml

Now, you can view your kubectl config:

kubectl config view
Getting the config of kubectl after installing and copying k3s k3s.yaml for kubernetes home lab
Getting the config of kubectl after installing and copying k3s k3s.yaml for kubernetes home lab

Since we have the kubectl config set correctly, we should be able to issue kubectl commands against the k3s node:

Getting the k3s nodes using kubectl
Getting the k3s nodes using kubectl

Learn more about k3s here: https://k3s.io/.

4. Docker Desktop Kubernetes

You may not have realized, but Docker Desktop includes setting up a Kubernetes environment right from within the interface under the Settings menu. If you navigate to your settings, you will see the Kubernetes option listed.

All you have to do for installation is check the Enable Kubernetes checkbox.

Docker desktop kubernetes home lab
Docker desktop kubernetes home lab

Click the Install button to pull the images and install the required components for Kubernetes.

Confirming the kubernetes installation in docker desktop and restarting
Confirming the kubernetes installation in docker desktop and restarting

Now, we can change context to use the docker-desktop configuration for Kubernetes:

kubectl config use-context docker-desktop

We can see after changing the context, we can run the kubectl get nodes command and see we are indeed connected to docker-desktop configuration context.

Changing kubectl context to use docker desktop
Changing kubectl context to use docker desktop

Learn more about Docker Desktop here: https://www.docker.com/products/docker-desktop/.

5. Rancher Desktop

Rancher Desktop is an alternative solution to Docker Desktop for running containers on a desktop machine. But, one of the things that I like about Rancher Desktop is it is more Kubernetes-centric out of the box. In fact, the solution already runs Kubernetes under the hood with k3s.

Rancher desktop running on k3s
Rancher desktop running on k3s

Installation Instructions

To enable Kubernetes in Rancher Desktop, you just install the solution. A great feature of Rancher Desktop is that it allows you to choose which version of Kubernetes you want to run. This is a great feature since it allows developers or home labbers to run a specific version of Kubernetes of their choose to align with production environments, etc.

Rancher desktop allows you to choose which version of kubernetes you are running
Rancher desktop allows you to choose which version of kubernetes you are running

Learn more about Rancher Desktop here: https://rancherdesktop.io/.

Kubernetes basics

Now that we have a few distributions to think about, letโ€™s talk about a few of the basics before working with Kubernetes clusters.

Hardware and network

To run Kubernetes, you really donโ€™t have to have special bare metal hardware. Kubernetes can run on Raspberry Pi devices, virtual machines, and very lightweight desktop computers that may be considered to be old.

However, it is still important to give some thought to the right hardware and make sure you have a network setup to support multiple nodes. You will want to have ip addresses defined and setup in your home network to handle the Kubernetes nodes as well as extra IPs for services if you use something like MetalLB load balancer. So your network requirements may vary depending on the number of services, nodes, etc.

With the desktop solutions like Docker Desktop and Rancher Desktop these NAT the traffic coming in so you donโ€™t really need the additional IP addresses for your environment running in these.

Control plane vs worker nodes

Do understand the difference between the control plane nodes and worker nodes. What are these?

Control Plane:

  • The control plane is installed on your master node
  • Can be both a control plane node and a worker node
  • It houses the API server, scheduler, and controller manager settings

Worker Nodes:

  • This is where the kubelet and kube-proxy are installed
  • You can use the kubeadm join command to join workers to the master node to form the cluster

Configuring Shared Storage

If you really want to have the benefits of production style Kubernetes in your Kubernetes homelab, you will definitely want to have some type of shared storage. This can be configured using something like NFS or you can use open-source solutions like Longhorn to have HCI-type storage for your Kubernetes cluster.

Once you have your shared storage configured, you then configure your storage class and persistent volume claims to utilize the shared storage efficiently.

kubectl

As we have seen in the screenshots above, kubectl is a valuable tool in working with Kubernetes clusters. It is the defacto tool that is used for interacting with a K8s cluster. Become familiar with kubectl and it will be your friend in working with Kubernetes.

Common commands include:

kubectl get nodes
kubectl get pods
kubectl get all -A

Advanced Features

There are several advanced features and capabilities you can take advantage of with Kubernetes and running a Kubernetes home lab.

  • High Availability: HA is configured by deploying multiple control plane nodes and configuring load balancers for traffic
    • Microk8s does load balancing out of the box when you join more than one node together, which is great
    • Using k3s with kubevib and k3sup allows creating HA clusters
  • Terraform Provider: You can use Terraform to automate the deployment and management of your Kubernetes cluster.

Monitoring and Logging

You will want to setup monitoring and logging to be able to understand what is going on with your cluster at all times. Thankfully, there are many open source tools that allow you to do this:

  • Monitoring: You can use Prometheus and Grafana to visualize resource usage and performance metrics.
  • Logging: You can use solutions like Elasticsearch, Fluentd, and Kibana (EFK) stack. These allow you to collect and analyze logs from your Kubernetes cluster.

Wrapping up

Setting up a Kubernetes home lab cluster is an excellent way to build your knowledge and get hands-on experience with Kubernetes. The skills you develop in your home lab can easily translate to production environments. As more companies move to containerized applications and refactor legacy apps to run in containers and the cloud, these skills are becoming more and more valuable.

Start with the basics of understanding containers, then explore simple Kubernetes distributions like Microk8s, Minikube, k3s, Docker Desktop, and Rancher Desktop. If youโ€™ve found other Kubernetes home lab distributions useful or want to share what youโ€™re using, let me know in the comments!

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.