Kubernetes Minikube for Local Development



Getting started with Kubernetes typically involves provisioning and managing a multi-node cluster — a process that can be resource-intensive and complex, especially for development or testing purposes. That's where Minikube comes in; it provides a streamlined solution by running a single-node Kubernetes cluster locally using a virtual machine or container runtime. It simulates a real Kubernetes environment on our workstation, allowing us to build, test, and debug workloads without needing external infrastructure.

In this chapter, we will explain how to install and use Minikube effectively. Whether we're deploying an app or experimenting with Ingress, this setup gives us a safe playground without needing a cloud provider.

Why Minikube?

Minikube is ideal when:

  • We want a simple and quick Kubernetes environment for development.
  • We're trying out new manifests or Helm charts before deploying to production.
  • We're working offline or prefer not to incur cloud costs.
  • It supports most Kubernetes features, including LoadBalancer services, Ingress controllers, persistent volumes, and even GPU support if needed.

Prerequisites

Before we dive in, let's make sure we have the following:

  • A machine with at least 2 CPUs, 4GB of RAM, and 20GB of free disk space.
  • A supported OS with Kubernetes Cluster Running.
  • A container runtime like Docker, containerd, or CRI-O.

This guide assumes you're on Ubuntu Linux for this walkthrough, but the steps are quite similar across platforms.

Install Minikube

Let's download and install Minikube:

$ curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 
$ sudo install minikube-linux-amd64 /usr/local/bin/minikube 

Output

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100  119M  100  119M    0     0  27.0M      0  0:00:04  0:00:04 --:--:-- 29.8M

To verify:

$ minikube version 

Output

minikube version: v1.35.0 
commit: dd5d320e41b5451cdf3c01891bc4e13d189586ed-dirty 

Start Minikube

Minikube uses different “drivers” to run Kubernetes: Docker, VirtualBox, KVM, etc. In this case we'll use containerd:

$ sudo minikube start --driver=none --container-runtime=containerd

Output

* Verifying Kubernetes components...
- Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

Alternatively, on systems with lower RAM (like 4GB), we can tweak the resource usage:

$ minikube start --memory=2048 --cpus=2 --driver=docker 

We can confirm everything is working:

$ minikube status 

Output

minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured 

Deploy a Sample Application

Let's test things out by deploying a basic app. We'll use an NGINX web server.

$ kubectl create deployment nginx --image=nginx 

Output

 
deployment.apps/nginx created 

$ kubectl expose deployment nginx --port=80 --type=NodePort 

Output

service/nginx exposed 

To access it, we can ask Minikube to open a browser:

$ minikube service nginx 

Output

|-----------|-------|-------------|--------------------------|
| NAMESPACE | NAME  | TARGET PORT |           URL            |
|-----------|-------|-------------|--------------------------|
| default   | nginx |          80 | http://172.16.16.5:30669 |
|-----------|-------|-------------|--------------------------|
* Opening service default/nginx in default browser...
http://172.16.16.5:30669

This launches our default browser and opens the service. Behind the scenes, it maps a NodePort to the container port.

Alternatively, we can get the URL manually:

$ minikube service nginx --url 

Output

http://172.16.16.5:30669 

Enable the Kubernetes Dasard

Minikube comes with a built-in dasard that makes cluster management visual.

To launch it:

$ minikube dasard 

Output

* Verifying dasard health ...
* Launching proxy ...
* Verifying proxy health ...
http://127.0.0.1:40481/api/v1/namespaces/kubernetes-dasard/services/http:kubernetes-dasard:/proxy/

This opens a web UI where we can view pods, deployments, services, logs, and more — without writing a single kubectl command.

view pods, deployments, services

To confirm if the dasard is running, run:

$ kubectl get pods -n kubernetes-dasard 

Output

NAME                                         READY   STATUS    RESTARTS   AGE
dasard-metrics-scraper-5d59dccf9b-mht4k   1/1     Running   0          15m
kubernetes-dasard-7779f9b69b-rv85m        1/1     Running   0          15m

Enable Addons

Minikube includes a variety of useful addons. Let's enable a few commonly used ones.

Metrics Server (needed for HPA):

minikube addons enable metrics-server 

Output

* metrics-server is an addon maintained by Kubernetes. 
   For any concerns contact minikube on .
You can view the list of minikube maintainers 
   at: https://.com/kubernetes/minikube/blob/master/OWNERS
- Using image registry.k8s.io/metrics-server/metrics-server:v0.7.2
* The 'metrics-server' addon is enabled

Ingress Controller:

$ minikube addons enable ingress 

Output

* ingress is an addon maintained by Kubernetes. For any concerns contact minikube on .
You can view the list of minikube maintainers at: https://.com/kubernetes/minikube/blob/master/OWNERS
- Using image registry.k8s.io/ingress-nginx/controller:v1.11.3
- Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.4.4
- Using image registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.4.4
* Verifying ingress addon...
* The 'ingress' addon is enabled 

To list all available addons:

$ minikube addons list 

Output

|-----------------------------|----------|--------------|--------------------------------|
|         ADDON NAME          | PROFILE  |    STATUS    |           MAINTAINER           |
|-----------------------------|----------|--------------|--------------------------------|
| ambassador                  | minikube | disabled     | 3rd party (Ambassador)         |
| amd-gpu-device-plugin       | minikube | disabled     | 3rd party (AMD)                |
| auto-pause                  | minikube | disabled     | minikube                       |
| cloud-spanner               | minikube | disabled     | Google                         |
| csi-hostpath-driver         | minikube | disabled     | Kubernetes                     |
| dasard                   | minikube | enabled ✅    | Kubernetes                     |
| default-storageclass        | minikube | enabled ✅    | Kubernetes                     |
| efk                         | minikube | disabled     | 3rd party (Elastic)            |
| freshpod                    | minikube | disabled     | Google                         |
| gcp-auth                    | minikube | disabled     | Google                         |
| gvisor                      | minikube | disabled     | minikube                       |
| headlamp                    | minikube | disabled     | 3rd party (kinvolk.io)         |
| inaccel                     | minikube | disabled     | 3rd party (InAccel             |
|                             |          |              | [[email protected]])            |
| ingress                     | minikube | enabled ✅    | Kubernetes                     |
| ingress-dns                 | minikube | disabled     | minikube                       |
| inspektor-gadget            | minikube | disabled     | 3rd party                      |
|                             |          |              | (inspektor-gadget.io)          |
| istio                       | minikube | disabled     | 3rd party (Istio)              |
| istio-provisioner           | minikube | disabled     | 3rd party (Istio)              |
| kong                        | minikube | disabled     | 3rd party (Kong HQ)            |
| kubeflow                    | minikube | disabled     | 3rd party                      |
| kubevirt                    | minikube | disabled     | 3rd party (KubeVirt)           |
| logviewer                   | minikube | disabled     | 3rd party (unknown)            |
| metallb                     | minikube | disabled     | 3rd party (MetalLB)            |
| metrics-server              | minikube | enabled ✅    | Kubernetes                     |
| nvidia-device-plugin        | minikube | disabled     | 3rd party (NVIDIA)             |
| nvidia-driver-installer     | minikube | disabled     | 3rd party (NVIDIA)             |
| nvidia-gpu-device-plugin    | minikube | disabled     | 3rd party (NVIDIA)             |
| olm                         | minikube | disabled     | 3rd party (Operator Framework) |
| pod-security-policy         | minikube | disabled     | 3rd party (unknown)            |
| portainer                   | minikube | disabled     | 3rd party (Portainer.io)       |
| registry                    | minikube | disabled     | minikube                       |
| registry-aliases            | minikube | disabled     | 3rd party (unknown)            |
| registry-creds              | minikube | disabled     | 3rd party (UPMC Enterprises)   |
| storage-provisioner         | minikube | enabled ✅    | minikube                       |
| storage-provisioner-gluster | minikube | disabled     | 3rd party (Gluster)            |
| storage-provisioner-rancher | minikube | disabled     | 3rd party (Rancher)            |
| volcano                     | minikube | disabled     | third-party (volcano)          |
| volumesnapshots             | minikube | disabled     | Kubernetes                     |
| yakd                        | minikube | disabled     | 3rd party (marcnuri.com)       |
|-----------------------------|----------|--------------|--------------------------------|

These add-ons are great for testing production-like features locally.

Clean Up

When we're done, we can stop the cluster:

$ minikube stop

Output

* Stopping node "minikube"  ... 

To delete everything:

$ minikube delete 

Output

* Uninstalling Kubernetes v1.32.0 using kubeadm ...
* Deleting "minikube" in none ...
* Removed all traces of the "minikube" cluster. 

Troubleshooting Tips

Minikube won't start? Check if virtualization is enabled in BIOS or try a different driver (--driver=docker).

kubectl connection errors? Make sure your kubeconfig points to Minikube. Run kubectl config use-context minikube.

Dasard not loading? Some browsers block insecure content. Try another browser or manually copy the URL.

Conclusion

Minikube offers a practical and efficient way for us to develop and test Kubernetes applications locally, without the overhead of managing remote infrastructure. It brings the full power of a Kubernetes cluster to our local machine, letting us experiment freely, build s, and debug in a controlled environment.