6 Tools to Run Kubernetes Locally
Kubernetes is a big and complicated technology and it clearly requires some time and dedication to wrap your head around. There is no vendor lock-in meaning it runs the same no matter which managed cloud platform you use it on. This means using it locally will be no different from using it on the cloud.
There are multiple tools for running Kubernetes on your local machine, but it basically boils down to two approaches on how it is done:
- running it from a single binary package
- running it as a container using Docker in Docker (DinD)
Before we move on to talk about all the tools, it will be beneficial if you installed
arkade on your machine. It will help you get these tools with a single command.
curl -sLS https://get.arkade.dev | sudo sh
All of the tools listed here more or less offer the same feature, including but not limited to:
- Multi-Node cluster
- Persistent volumes
- Bare-metal support
- Kubernetes Versions
- Tracks upstream Kubernetes
Single package binary
k3s is a lightweight Kubernetes distribution from Rancher Labs. It is specifically targeted for running on IoT and Edge devices, meaning it is a perfect candidate for your Raspberry Pi or a virtual machine.
It comes with a single binary of mere <40 MB and takes as low as 500 MB of RAM.
You can bootstrap k3s quickly using k3sup !
arkade get k3sup
k0s k0s is the latest entry on the block. By name, you might think it's a more stripped version of k3s, but it's an entirely different distribution from an entirely different company, called Mirantis. Contrary to the name, it comes in a larger binary of 150 MB+.
It can be run as a binary or in DinD mode. k0s takes security seriously and out of the box, it meets the FIPS compliance. Although, a new distribution, k0s has reached the production-ready status, so there wouldn't be an issue for development usage.
arkade get k0s
Microk8s MicroK8s is a Kubernetes distribution by Canonical, the company behind Ubuntu. You already saw this coming; it can only be installed using
snap. It comes with loads of add-ons baked in like Fluentd, Grafana and Prometheus.
If you are on Ubuntu or its derivatives that uses
snapyou'll feel right at home using MicroK8s.
sudo snap install microk8s --classic
Docker in Docker (DinD)
Running Docker inside of Docker (Inception anyone?) is a popular way of bootstrapping Kubernetes. The isolating nature of Docker makes running a multi-node cluster a breeze on a single machine, and also ensures the running instance does not affect the machine itself.
As the title suggests, you need to have Docker installed on your machine to go this route.
minikube Despite running on top of Docker and similar container technologies, minikube is really flexible in how it operates and supports multiple virtualization drivers making it adaptable to different computing environments. These include KVM2, Virtualbox, Podman, Hyperkit, Hyper-V and many more.
arkade get minikube
KinD Kubernetes in Docker (KinD) is similar to minikube but it does not spawn VM's to run clusters and works only with Docker. KinD for the most part has the least bells and whistles and offers an intuitive developer experience in getting started with Kubernetes in no time.
arkade get kind
k3d k3d is basically running k3s inside of Docker. It provides an instant benefit over using k3s on a local machine, that is, multi-node clusters. Running inside Docker, we can easily spawn multiple instances of our k3s Nodes.
arkade get k3d
Either you choose a single binary package or DinD approach, Kubernetes has made itself pretty accessible. For new learners, the barrier to entry is low, and the feedback loop is instantaneous.
I hope this article has been helpful in deciding which tool to use for running your local Kubernetes instance.