minikube start: Local Clusters for Tests
minikube start boots a local single-node Kubernetes cluster using a chosen driver and writes a kubeconfig context named minikube.
minikube is the long-standing local cluster tool. In CI it runs with the docker driver to give tests a real cluster, an alternative to kind with more built-in addons.
What it does
minikube start provisions a node via a driver (docker, kvm2, hyperkit, none), installs Kubernetes, and configures kubectl to point at it. Flags pin the version, allocate CPU/memory, and enable addons like ingress or the registry.
Common usage
minikube start --driver=docker
minikube start --driver=docker \
--kubernetes-version=v1.29.2 --cpus=2 --memory=4096
minikube addons enable ingress
minikube statusOptions
| Flag | What it does |
|---|---|
| --driver | VM/container driver: docker, kvm2, hyperkit, none |
| --kubernetes-version | Pin the Kubernetes version |
| --cpus / --memory | Resources for the node |
| --addons | Enable addons at start (e.g. ingress) |
| --wait | Components to wait on before returning |
In CI
Use --driver=docker on hosted runners since nested virtualization is usually unavailable. Pin --kubernetes-version for reproducibility, keep --cpus/--memory within the runner limits, and run minikube delete in cleanup so a reused runner starts clean.
Common errors in CI
Exiting due to DRV_NOT_HEALTHY: ... docker ... not running means the Docker daemon is down. Exiting due to RSRC_INSUFFICIENT_CORES or insufficient memory means --cpus/--memory exceed the runner; lower them. Unable to pick a default driver means no usable driver was detected; pass --driver=docker explicitly.
Using this in CI
A runner has no kubeconfig, no cached context, and no interactive auth. Every kubectl invocation in CI needs the context supplied explicitly, and most confusing CI failures here are the command running against the wrong cluster or no cluster at all.
# never rely on the ambient context on a runner
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get pods
# confirm what you are actually connected to before mutating anything
kubectl config current-context
kubectl cluster-info
# fail fast instead of hanging on an unreachable API server
kubectl --request-timeout=30s get nodes