Installing a Local Cluster
You would not learn to drive on a motorway. A local cluster is your empty car park: a real Kubernetes, on your own laptop, that costs nothing and that you can break and rebuild in a minute.
The rule
Two tools, one file: a cluster, kubectl, and the kubeconfig that joins them.
You need three things:
- A local cluster tool. Popular choices:
- kind ("Kubernetes in Docker") — runs each node as a Docker container. Fast to create and destroy; great for experiments and CI.
- minikube — a single-node cluster in a VM or container, with handy add-ons such as a dashboard.
- k3d — runs k3s, a lightweight Kubernetes distribution, inside Docker.
- Docker Desktop — has a Kubernetes switch in its settings.
- kubectl — the command-line client that talks to any cluster's API server.
- A kubeconfig file, usually
~/.kube/config. It stores each cluster's address and credentials as a context. Local tools write this for you.
With kind and Docker installed:
kind create cluster --name notes
kubectl config current-context
kubectl get nodesThe second command prints kind-notes; the third lists one node with status Ready.
The shortcut
Before any command, ask "which cluster am I pointed at?" Every kubectl command goes to the current context. Check it, then act.
Create
kind create cluster --name notesstarts a node container and adds akind-notescontext to your kubeconfig.
The trap is a stale context. If you tested against a company cluster yesterday, today's kubectl delete still goes there. kubectl config use-context kind-notes switches the pointer back.
Drills
Answer fast — trust the rule.
How does kind run a Kubernetes node?
Where does kubectl find a cluster's address and credentials?
Which command shows the cluster your next kubectl command will hit?
You have contexts kind-notes and work-prod. How do you aim kubectl at your laptop cluster?
Remember
- A local cluster tool (kind, minikube, k3d), kubectl, and the kubeconfig that joins them.
- Always ask "which cluster am I pointed at?" before acting.
- Trap: a stale context sending practice commands to a real cluster.
