Skip to content

Setup: Your Local Cluster

Every lab command runs from the lab/ folder.

  • Docker (already installed and working)
  • kind: Kubernetes-in-Docker
  • kubectl: the Kubernetes CLI
  • tilt: live development (Lab 7)
Terminal window
cd lab
make 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:

Terminal window
export PATH=$HOME/.local/bin:$PATH
Terminal window
make up

That 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.

Terminal window
docker ps # your 3 "servers" are containers: learn-control-plane, learn-worker, learn-worker2
kubectl get nodes -o wide
kubectl get pods -A # everything running, including the control plane itself
make status # our app: deployment, replicaset, pods, service, hpa
Terminal window
make down # delete the app (namespace)
make clean # delete the whole cluster