Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Ship the storefront and bring the stock service back

By updated

Improve this page

Logo Kubernetes

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 kubectl context 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:

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:

  1. Your active kubectl context points at the shop's cluster, and its default namespace is vitrine.
  2. A vitrine Deployment, in the vitrine namespace, has three available replicas on the reference image.
  3. A vitrine Service selects those three Pods.
  4. The storefront answers over HTTP at http://vitrine.vitrine from a Pod of the cluster. This requirement is blocking.
  5. A file ~/boutique/cause-stock.txt names why stock does not start and the faulty image. It is written before any repair.
  6. stock runs on the reference image, fixed in ~/boutique/stock.yaml and applied from that file.
  7. ~/.kube/boutique.yaml is 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.yaml manifest.
  • dsoxlab check shows where you stand as often as you like; dsoxlab submit returns the result.