Kubernetes clusters are not exactly cheap, can be complex to set up, and operate properly. For this reason, you may be tempted to reserve “true” online Kubernetes clusters for running your production workloads and have clusters running locally for development purposes.

In this post, we will explore different ways to easily set up a local Kubernetes cluster and the associated trade-offs that accompany them.

Local Kubernetes Clusters Challengers

Different solutions exist to run a Kubernetes cluster on your laptop. Let’s review a few of these.

Minikube

Minikube is the solution the Kubernetes project documentation advises you to use. It deploys a VM with a single node cluster. You pay the price of virtualization, as seen in the minimum requirements for the host machine (2 CPU, 2 Go RAM, 20 Gb storage)

This is a simple yet effective way to learn kubectl commands. For a long time, the single node implementation created some hurdles but the Minikube team introduced the multi-node as an experimental feature recently to help correct this issue.

Kind

Kind is another approach from the Kubernetes SIG to deploy a cluster locally. The trick here is to have the whole cluster jammed into a Docker container. Consequently, it’s easier to set up and faster to boot than Minikube. It supports all typologies of the cluster from single node and multiple masters or workers.

Kind was first and foremost created for conformance testing and for use in CI pipelines which give you some nice features like the ability to load Docker images directly inside the cluster without needing to push to an external registry.

K3S/K3D

K3s is a lightweight fully conformant cluster. To achieve this minimalism, some trade-offs are made, including:

  • The default storage for the Kube-apiserver is using SQLite instead of etcd
  • All the control plane components are packaged in a single binary
  • The numbers of external dependencies are kept in check

K3d is a helper project allowing you to run k3s inside a Docker container as Kind would do.

Which One Should I Pick?

My personal requirements are:

  • Clusters should start and stop quicklyClusters should have a realistic topology
  • Different clusters can run side by sideClusters must use minimal system resources
  • The best fit for me is k3d because it’s easy to set up, it runs in Docker, consumes few resources, and is fully-featured out of the box.
  • Let’s now see how to set up a cluster using k3d.

#kubernetes #traefik #k3s #programming #software-development #containers #devops #how-to

Managing Local Kubernetes Cluster with Lightweight Kubernetes and Traefik Proxy
2.00 GEEK