Setup: Your Local Cluster
Every lab command runs from the lab/ folder.
What you need
Section titled “What you need”- Docker (already installed and working)
- kind: Kubernetes-in-Docker
- kubectl: the Kubernetes CLI
- tilt: live development (Lab 7)
cd labmake tools # installs kind, kubectl, tilt into ~/.local/bin (no sudo)If your shell can’t find them, add this to ~/.bashrc and open a new terminal:
export PATH=$HOME/.local/bin:$PATHOne command to get everything running
Section titled “One command to get everything running”make upThat runs, in order (each step prints the real command):
| Step | Command | What happens |
|---|---|---|
cluster |
kind create cluster --config kind/cluster.yaml |
3 Docker containers become 3 Kubernetes nodes |
metrics |
kubectl apply -f …metrics-server… |
Installs CPU/memory metrics (needed for autoscaling) |
build |
docker build --target prod -t demo-app:1.0 app |
Builds our image |
load |
./scripts/kind-load.sh demo-app:1.0 |
Copies the image into the nodes (no registry needed) |
deploy |
kubectl apply -f k8s/… |
Namespace, ConfigMap, Deployment, Service, HPA |
Then open http://localhost:8080. That’s the live visualizer.
Look around
Section titled “Look around”docker ps # your 3 "servers" are containers: learn-control-plane, learn-worker, learn-worker2kubectl get nodes -o widekubectl get pods -A # everything running, including the control plane itselfmake status # our app: deployment, replicaset, pods, service, hpaTear down
Section titled “Tear down”make down # delete the app (namespace)make clean # delete the whole cluster