Setup a Local K8s environment
If you are lucky enough to have a development Kubernetes cluster setup for your team, you may not be interested in this post. However, It’s possible to simulate the production cluster locally on your Laptop!
I will present 4 tools to run K8s cluster(s) locally. Keep in mind that the cloud and DevOps world is changing rapidly and new tools and platforms are popping up everyday!
Docker Desktop is an easy-to-install application for your Mac or Windows environment that enables you to build and run containerized applications. It includes a single-node Kubernetes cluster which runs as a docker container within Docker (a little bit of inception)!
A multi-node K8s cluster is deployed normally on multiple hosts. These hosts can be bare-metal hardware in a data center or virtual machines. If you are interested in deploying a real world cluster on real hardware, consider the deployment on Raspberry Pi ;)
If you like to confuse yourself more about Docker & K8s, I strongly recommend this article.
Minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes. It allows you to run a multi-node clusters on multiple deployment (which you don’t have on Docker Desktop). Minikube can be deployed on container runtime (not all containers are Docker ;), Virtual machine like Oracle VirtualBox or directly on hardware. for all possible deployment scenarios, please check the drivers!
If you like to know more about the differences between Docker Desktop & Minikube, I strongly recommend this well-written post.
While Minikube can run K8s cluster on containers, VMs and bare-metal, Kind deploys K8s on Docker containers. This leads to a significantly faster startup speed compared to spawning VM. It can be used as learning environment as well as a development environment for a team! Kind supports multi-node (including high-availability) clusters. It runs on Linux, macOS, and Windows.
Both Minikube & kind give you for freedom to configure the local cluster (like load balancer, ingress..,) than Docker Desktop. For more details about the differences between Minikube & Kind, have a look here.
There is a major difference in the installation of 3.x & 4.x Openshift. Therefore, If you want to run a single-node K8s cluster, use Minishift. It runs the cluster on a VM. Code Ready Containers CRC brings a minimal OpenShift 4.x cluster to your local computer that provides a minimal environment for development and testing purposes. CRC is mainly targeted for use on developers’ desktops.
The best way to understand the modern distributed and containerized application deployment is to get your hands dirty with code! Running a local Kubernetes cluster for learning and development on your laptop is the best way to start. There are many tools and framework online and the 4 presented tools should be a good start for a single-node cluster.