Practice · Module 07 — Kubernetes: basic concepts · Level beginner → intermediate
Try alone first! Complete the project with this brief only. The solution (commented YAML manifests +
kubectlcommands) is in the README.md, folded. Open it only after you have tried.
You have nothing extra to install: Docker Desktop includes a built-in Kubernetes cluster.
kubectl get nodesdocker-desktop node in the Ready state.(Possible alternatives:
minikube startorkind create cluster. The project works there too, provided you load the image — see 02-COMMANDES.md.)
Deploy a small web application on Kubernetes in several replicas (Pods), expose it via a Service, then practice everyday gestures: scaling, rolling update, rollback, and self-healing.
When you reload the page, the name of the Pod that answers changes: proof that the Service distributes the load across the Pods.
/, displays its hostname = the Pod name).demo-k8s:1.0.Deployment manifest with 3 replicas, consistent labels (app: demo-web) and a probe (readinessProbe / livenessProbe) on /health.kubectl get pods, kubectl describe pod ..., kubectl logs ...).Service of type NodePort (port 30080) that points to the Pods via the label selector.http://localhost:30080 and reload: check that the Pod name changes.ConfigMap containing APP_TITLE, APP_VERSION, and BG_COLOR, and inject it into the Pods (envFrom).BG_COLOR, re-apply the ConfigMap, restart the Pods (kubectl rollout restart), and observe the new color.kubectl scale) then back to 3.APP_VERSION, apply, and follow the progressive deployment (kubectl rollout status).kubectl rollout undo).kubectl delete pod ...) and see that Kubernetes recreates one by itself.app/ folder (code + Dockerfile) and the k8s/ folder (configmap.yaml, deployment.yaml, service.yaml).curl).kubectl get pods showing 3/3 Pods Running.kubectl rollout status during a rolling update.| Criterion | Expected |
|---|---|
| Image built | demo-k8s:1.0 available to the cluster |
| Deployment | 3 Pods Running, probes OK |
| Service | Page reachable at localhost:30080, the Pod name changes |
| ConfigMap | BG_COLOR change visible after re-applying |
| Lifecycle | Scaling, rolling update, rollback, and self-healing demonstrated |
Stuck? The README.md contains the full solution (commented manifests + commands), and the command cheat sheet lists every useful
kubectl— read them after you have tried.