This challenge checks that you can, on your own, get a volume from a StorageClass, mount it in an application, keep its data when the Pod disappears and fix a claim (PersistentVolumeClaim, or PVC) that stays in Pending. It is meant for people who have just followed the two storage lessons listed below. It runs in a dsoxlab virtual machine, on a kind cluster with Kubernetes 1.37, and takes about 40 minutes. It gives no hints and teaches nothing new: it checks what the lessons of the module and their guided lab have already let you practice.
What you will learn
The lab reads the claim, the volume, the Pod of the application, its files and the notes file you leave behind. It checks that you can:
- Create a StorageClass served by the provisioner the cluster already uses, and get a volume created for a claim of imposed size and access mode.
- Mount the claim in a Deployment and write a witness file in it.
- Check that the file survives the deletion of its Pod.
- Keep the volume even if the claim goes away.
- Record the cause of a claim left in
Pending, then fix it.
What should you be able to do before you start?
No step-by-step guide goes with the challenge, and choosing the right fields is part of what it checks. Everything it asks is taught in two lessons:
- Dynamic storage provisioning with Kubernetes StorageClass, whose guided lab
cka-storageclass-provisionnement-dynamiquelets you practice creating a class and getting a volume. - Kubernetes storage: PV, PVC, StorageClass and permissions, which teaches the claim, the volume and the reclaim policy.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
The archives team wants its registre application to keep its data when its Pod disappears. It lives in the archives namespace. You are connected with kubectl configured on the kind cluster lab. A claim, journal-ancien, was set up by another team and has stayed Pending since it was created. The ~/archives/ directory is empty. The application uses the image busybox:1.38.0@sha256:a46257e06c82ad85242d0d38077d0a52d9896389ca60a1a59d3463db586e5fa4.
The statement says what must be true at the end, never how to get there:
- A
conserveStorageClass is served by the provisioner the cluster already uses for its default class. Theregistre-donneesclaim, inarchives, names it and requests256MiinReadWriteOnce. It is bound to a volume that this provisioner created for it: no volume prepared in advance. This requirement is blocking. - A
registreDeployment, with one replica, mountsregistre-donneeson/var/lib/registre. The witness file/var/lib/registre/temoin.txtholds, on its first line, the name of the Pod that wrote it. - You delete that Pod. The Pod that the Deployment recreates reads the witness again intact: same content, never rewritten since. This requirement is blocking.
- The volume of
registre-donneeskeeps its data if the claim goes away: its reclaim policy isRetain, read on the PersistentVolume. - Before any fix, you write in
~/archives/cause.txtwhyjournal-ancienstaysPending: what it asks for without finding it, by its name, and that it is missing. After that, you do not touch the file again. This requirement is blocking. journal-ancienis bound to a volume and still requests100Mi.
How do you start the challenge and get graded?
The lab prepares the cluster and reads its state again when you ask for your grade. You start it with dsoxlab run k8s-challenge-donnees-qui-survivent. Two commands are then used: dsoxlab check k8s-challenge-donnees-qui-survivent tells you where you stand, requirement by requirement, as many times as you like, and dsoxlab submit k8s-challenge-donnees-qui-survivent returns the final result. The grade never looks at the commands you typed: it reads the cluster and your files.
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, as a colleague taking over your work would do.
How is the challenge graded?
The pass mark is 70 out of 100. The six requirements weigh the same: six met give 100, five give 83, four give 67, below the pass mark. Requirements 1, 3 and 5 are blocking: if one of the three is not met, the challenge fails, whatever the total.
If a requirement resists, reread the lesson that teaches it, among the two 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 and of your files, not your commands.
- Requirements 1, 3 and 5 are blocking: the volume created by the class, the witness read again intact and the cause of the
Pendingrecorded before the fix. - The volume survives the claim when its reclaim policy is
Retain, which you read on the PersistentVolume. dsoxlab checkshows where you stand as often as you like;dsoxlab submitreturns the result.