Lab 2: First Deployment
make up did this all at once. Here it is slowly, so you see each piece.
make down # start from an empty namespacekubectl apply -f k8s/00-namespace.yamlkubectl apply -f k8s/10-configmap.yamlkubectl get configmap demo-config -n demo -o yamlIn another terminal, watch pods appear:
make watchNow create the Deployment:
kubectl apply -f k8s/20-deployment.yamlIn the watch terminal: Pending → ContainerCreating → Running, with READY 0/1 for ~2s (our fake warm-up, so readiness fails), then 1/1.
kubectl get deploy,rs,pods -n demo -o wide # see the Deployment → ReplicaSet → Pods chainkubectl describe pod -n demo -l app=demo | grep -A12 EventsThe browser shows nothing yet because there’s no Service. Add it:
kubectl apply -f k8s/30-service.yamlkubectl get endpointslices -n demo # the pod IPs behind the ServiceOpen http://localhost:8080. Three pod cards, traffic split between them.
Explore
Section titled “Explore”make logs # logs from all pods, prefixed with pod namekubectl exec -it -n demo deploy/demo -- sh # shell in a pod wget -qO- http://demo/api/whoami # call the Service by DNS name from inside exitkubectl get pod -n demo -l app=demo -o yaml | less # the full spec + statusFinish by adding the autoscaler back: kubectl apply -f k8s/40-hpa.yaml.