This challenge checks that you can, on your own, point kubectl at the right cluster, ship a web application behind a Service and bring back to life a Deployment whose Pods do not start. It is meant for people who have just followed the lessons of the Fundamentals module, up to reading the state of the cluster. It runs in a dsoxlab virtual machine, on a kind cluster named boutique with Kubernetes 1.37, and takes about 30 minutes. It gives no hints and teaches nothing new: it checks what the lessons have already let you practice.
What you will learn
The grader reads the kubectl context, the objects of the cluster, two files and the permissions of the kubeconfig. It checks that you can:
- Set the active
kubectlcontext on the shop's cluster, with the requested default namespace. - Ship a Deployment with three available replicas, then expose it with a Service that selects its Pods.
- Check that the application answers over HTTP from a Pod of the cluster.
- Find why a Deployment does not start and write down the cause before repairing it.
- Repair a Deployment by fixing its manifest, then applying it from that file.
- Restrict a kubeconfig to its owner only.
What should you be able to do before you start?
No step-by-step guide goes with the challenge, and choosing the right steps is part of what it checks. Everything it asks is taught in three lessons of the Fundamentals module:
- Kubeconfig and contexts: choose the cluster and the namespace of
kubectl, and protect a kubeconfig; - Deploy your first application on Kubernetes: create a Deployment, expose it with a Service, apply it from a manifest;
- Read the cluster state: read an error status with
kubectl get,describeandlogs.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
The shop runs on a kind cluster named boutique. You were handed its kubeconfig, copied to ~/.kube/boutique.yaml, and your kubectl already knows it, but someone left it pointing at an old cluster. In the catalogue namespace, the stock service does not start: its manifest is in ~/boutique/stock.yaml. The storefront still has to be shipped. The shop's reference image is nginx:1.30@sha256:9bf97bd7714f5e24c1ccd545ecb9eb5435cb6d109c97cebb15e7e455e0239edb.
The statement says what must be true at the end, never how to get there:
- Your active
kubectlcontext points at the shop's cluster, and its default namespace isvitrine. - A
vitrineDeployment, in thevitrinenamespace, has three available replicas on the reference image. - A
vitrineService selects those three Pods. - The storefront answers over HTTP at
http://vitrine.vitrinefrom a Pod of the cluster. This requirement is blocking. - A file
~/boutique/cause-stock.txtnames whystockdoes not start and the faulty image. It is written before any repair. stockruns on the reference image, fixed in~/boutique/stock.yamland applied from that file.~/.kube/boutique.yamlis readable by you only. This requirement is blocking.
How do you start the challenge and get graded?
The lab prepares the cluster and the files, then reads their state again when you ask for your grade. You start it with dsoxlab run k8s-challenge-premier-deploiement. Two commands are then used: dsoxlab check k8s-challenge-premier-deploiement shows the requirements that still fail, as many times as you like, and dsoxlab submit k8s-challenge-premier-deploiement returns the final result. The grade never looks at the commands you typed: it reads the cluster, the files and the permissions of the kubeconfig.
Put it into practice
This lab is the challenge itself. It puts you in front of the situation described above and it is validated on the state of the cluster and of the files, as a colleague taking over your work would do.
How is the challenge graded?
The pass mark is 70 out of 100. Seven criteria of equal weight make up the grade: the context, the three replicas, the Service, the HTTP answer, the recorded cause, the Deployment repaired through its manifest and the permissions of the kubeconfig. Five criteria met give 71, just above the pass mark. Requirements 4 and 7 are blocking: if either one is not met, the challenge fails, whatever the total.
If a criterion resists, reread the lesson that teaches it, in the list of the prerequisites section, then run dsoxlab check again.
Key points
- The challenge is a final exercise to do alone and without hints: it explains nothing and grades the state of the cluster, not your commands.
- Requirements 4 and 7 are blocking: the storefront answers over HTTP, and the kubeconfig is readable by you only.
- The cause of the failure is written before the repair, and the repair goes through the
~/boutique/stock.yamlmanifest. dsoxlab checkshows where you stand as often as you like;dsoxlab submitreturns the result.