Kubernetes Cluster (kind)
Local Kubernetes for learning + experimentation. No cloud account needed.
Step 1: Install kind
kind is the lightest path to a real Kubernetes cluster on your laptop; it boots Kubernetes in Docker, no cloud account needed.
- macOS.
brew install kind. - Go.
go install sigs.k8s.io/kind@latestif you already have a Go toolchain. - Verify.
kind versionprints the client version; mismatch with kubectl is rarely a problem at this stage. - Prereq. Docker Desktop or a Docker-compatible runtime running locally; kind shells out to it.
Step 2: Create cluster
One command brings up a single-node control plane. Boot is roughly 60 seconds depending on whether the node image is cached.
- Create.
kind create cluster --name learnspins the cluster and switches your kubectl context to it. - Wait. First-time pulls the node image; subsequent runs are seconds.
- Verify.
kubectl get nodesshows one node inReadystate. - Multi-node. Pass a config file with worker entries when you outgrow single-node; the rest of this tutorial does not need it.
Step 3: Deploy app
The smallest possible workload is an off-the-shelf nginx image; it proves the cluster can pull, schedule, and run a container.
- Create.
kubectl create deployment nginx --image=nginxcreates the Deployment and ReplicaSet. - Inspect.
kubectl get podslists the single pod;kubectl describe pod <name>shows the events if it is stuck. - Logs.
kubectl logs deploy/nginxtails the container output; nginx logs requests once exposed. - Scale.
kubectl scale deploy/nginx --replicas=3proves the scheduler is doing real work.
Step 4: Expose service
The pod runs but has no ingress until a Service object fronts it; port-forward then lets your laptop reach the cluster IP.
- Service.
kubectl expose deployment nginx --port=80creates a ClusterIP Service in front of the pods. - Port-forward.
kubectl port-forward svc/nginx 8080:80tunnels local 8080 to the service. - Verify. Visit
http://localhost:8080; the nginx welcome page is your proof of life. - Cleanup.
kind delete cluster --name learntears the whole thing down when you are done.
Antipatterns
- kind in production. Wrong tool; for learning only.
- Skipping port-forward. No way to see the result.
- Running without cleanup. Resources accumulate.
What to do this week
Three moves. (1) Run the tutorial end-to-end on your own laptop / sandbox. (2) Apply the pattern to one production workload. (3) Document the variations you needed; share with the team.