Skip to content

Introduction

As the name implies, Kubernetes at Home, or k8sh, is a guide to setting up a home-based kubernetes lab. It targets beginner to intermediate kubernetes users.

Why is this needed?

There already exists a plethora of solutions, such as minikube, and various tutorials to help you get started with kubernetes. However if your goal is to set up a non-trivial cluster at home using, for instance, kubeadm, there aren't many guides available that would be both high quality and approachable to non-experts.

One of the major pitfalls with most how-tos is that they dive right into commands without spending any time on architecture. This is not an issue for a seasoned kubernetes administrator, but it can be really painful for a newbie. Additionally, many instructions include commands that just plain don't work. It could be due to typos or not keeping up-to-date with the latest technology developments.

We strive to address these shortcomings. Here you will find an end-to-end walk-through of how to set up and configure a home-grown kubernetes lab from the ground-up with Ubuntu 20.04 LTS, KVM, and kubeadm. First, we are dedicating a whole section to lab's architecture, with particular focus on network layout. Next, we will build a small, but capable, k8s cluster on a single physical host. At the end, we'll deploy some test workloads to verify that the whole setup is working.

Getting the most out of this guide

You'll find this walk-through particularly helpful, if you understand the basic concepts of kubernetes, but are still not as experienced as a seasoned k8s administrator. Some foundational knowledge of Linux is expected, as we won't be covering things like installing the OS from scratch.

The walk-through follows a specific path to make set up as painless as possible:

  • The architecture section covers hardware requirements, lab layout, and network planning. Do not skip this chapter!
  • Next we'll install the KVM hypervisor on the physical machine that will be hosting the k8s master and worker VMs. This section assumes that you have already installed the Ubuntu 20.04 LTS server on the system.
  • Then we'll proceed to setting up kubernetes master and worker nodes. Each node has to be prepared for the k8s installation.
  • Finally, we'll deploy MetalLB software load balancer, which will enable us to create LoadBalancer type of services.

At the end of each chapter you will find a validation procedure, which ensures that everything has been set up correctly. If you encounter errors during validation, please fix them before proceeding to the next chapter.

Note

This guide doesn't cover how to set up a production grade k8s cluster, as many security, manageability, and reliability aspects have been skipped or glossed over. That being said, the cluster you end up with after following our instructions can serve as a great foundation for building a more robust environment.

With all of this being said, we are excited that you expressed interest in this resource and wish you a smooth journey towards a working k8s home lab!