Sub topic 5
kind or minikube: which to use
This chapter assumes you have a container runtime installed and have created a cluster with each tool in the previous two chapters. It gives you criteria for picking one for a given workflow.
What differs under the hood
kind runs each Kubernetes node as a Docker container. It needs a container runtime and nothing else. minikube runs a single node by default, and it can place that node in a container, a virtual machine, or on bare metal, depending on the driver you choose.
That difference explains most of the trade-offs below.
| Aspect | kind | minikube |
|---|---|---|
| Node implementation | Container per node | Container or VM, set by driver |
| Multi-node | Declared in a config file | Supported with the `--nodes` flag |
| Reaching a NodePort | Needs `extraPortMappings` at creation | `minikube service` or `minikube tunnel` |
| Loading local images | `kind load docker-image` | `minikube image load` |
| Addons | None built in, you install manifests yourself | Built in, for example `minikube addons enable ingress` |
| Context name | `kind-<name>` | The profile name |
When kind fits
Choose kind when you want clusters that start fast and are cheap to discard. It suits continuous integration, where a pipeline creates a cluster, runs tests, and deletes it. It also suits testing multi-node behavior, since a config file describes the whole topology and you can recreate it exactly.
The cost is that networking to the host is not automatic. A NodePort is reachable from your machine only if you mapped the port when you created the cluster. Changing the mapping later means recreating the cluster.
When minikube fits
Choose minikube when you want a more complete workstation environment. Its addons let you enable an ingress controller, a metrics server, or a dashboard with one command. Its drivers let you run the node in a VM, which gives stronger isolation from the host. Profiles let you keep several clusters side by side and stop them without deleting them.
The cost is more moving parts. Driver problems are a common source of failed starts, and the experience differs between drivers.
Decision criteria
Ask these questions in order:
- Is this for automated tests or a pipeline? Use kind.
- Do you need a VM boundary or a specific hypervisor? Use minikube.
- Do you want one-command addons such as ingress? Use minikube.
- Do you need a reproducible multi-node topology in version control? Use kind.
- If none of these applies, use the tool you already have installed. The manifests you deploy are the same on both.
Check your understanding
Exercise
Your team wants every pull request to run integration tests against a fresh three-node cluster that is deleted afterward. A developer on the team also wants to try the ingress controller on a laptop with one command. Which tool would you choose for each need, and why?
Show answer
Use kind for the pull request pipeline. Its nodes are containers, so clusters start quickly, and a config file describes the three-node topology reproducibly. Use minikube for the laptop experiment, because minikube addons enable ingress installs an ingress controller without extra manifests.