Local Clusters: minikube & kind

minikube and kind let you run a full Kubernetes cluster on your own laptop for learning and testing.

You do not need a cloud account to learn Kubernetes. Two popular tools create a real cluster on your machine:

  • minikube β€” runs a single-node cluster inside a VM or container. Great for beginners.
  • kind β€” "Kubernetes IN Docker"; runs nodes as Docker containers. Fast and popular for CI.

Getting started with minikube

After installing it, one command boots a cluster and points kubectl at it automatically:

minikube start

From there, every kubectl command talks to your local cluster. When you are done, minikube stop pauses it and minikube delete removes it entirely.

Contexts

A context tells kubectl which cluster and user to use. kubectl config get-contexts lists them and kubectl config use-context NAME switches between, say, your local cluster and a production one.

Example

Example Β· bash
# Start a local single-node cluster
minikube start

# Confirm it is running
kubectl get nodes

# Open the built-in dashboard in your browser
minikube dashboard

# Stop it when finished
minikube stop

When to use it

  • A developer runs minikube to test a new Helm chart on their laptop before submitting it to the staging cluster.
  • A team uses kind in CI to run Kubernetes integration tests against a real API server without cloud infrastructure costs.
  • A student uses minikube to learn Kubernetes hands-on locally without requiring a cloud provider account.

More examples

Start and verify minikube cluster

Starts a single-node minikube cluster using the Docker driver and verifies the node is Ready to schedule pods.

Example Β· bash
minikube start --driver=docker --cpus=2 --memory=4096
kubectl get nodes
minikube status

Expose service with minikube tunnel

Creates a deployment, exposes it as LoadBalancer, then tunnels external traffic through so localhost can reach the service.

Example Β· bash
kubectl create deployment hello --image=nginx
kubectl expose deployment hello --port=80 --type=LoadBalancer
minikube tunnel

Multi-node kind cluster config

Defines a kind cluster with one control-plane and two worker nodes, enabling local testing of multi-node scheduling.

Example Β· yaml
# kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
  - role: worker
  - role: worker

Discussion

  • Be the first to comment on this lesson.
Local Clusters: minikube & kind β€” Kubernetes | SoundsCode