This challenge checks that you can, on your own, ship an application in its own namespace, give it a configuration through a ConfigMap and a password through a Secret, expose it with a Service, then move to a new version of its image. It is meant for people who have just followed the lessons of the Basic resources module. 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 objects of the cluster and what a Pod sees from the inside. It checks that you can:
- Create the namespace of an application and put all its objects in it.
- Run a Deployment with three available replicas.
- Provide a configuration value to a container from a ConfigMap.
- Provide a password from a Secret, without ever writing it in the Deployment.
- Expose the application with a Service that counts its ready Pods and answers over HTTP.
- Update the image while keeping the old ReplicaSet at zero replicas.
What should you be able to do before you start?
No step-by-step guide goes with the challenge, and choosing the right objects is part of what it checks. Everything it asks is taught in six lessons of the Basic resources module:
- Kubernetes namespaces: create a namespace and put objects in it;
- Kubernetes Deployments: run a number of replicas and give them variables;
- Kubernetes ConfigMaps: provide configuration to a container;
- Kubernetes Secrets: provide sensitive data without writing it in the Deployment;
- Kubernetes Services: expose Pods and reach the Service by its name;
- Kubernetes rolling updates and rollbacks: change the image of a Deployment and follow its ReplicaSets.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
The shop runs on the kind cluster boutique, and your kubectl already points at it. Its storefront must be shipped in a namespace of its own, magasin, which does not exist yet: nothing is in place, you create everything. The two images of the storefront, current version then next version, are nginx:1.30.5@sha256:9bf97bd7714f5e24c1ccd545ecb9eb5435cb6d109c97cebb15e7e455e0239edb and nginx:1.30.6@sha256:42c68eab6f7e22611786a9fe1d1c019e275c50185bd54b8f75dc2b9184322703.
The statement says what must be true at the end, never how to get there:
- All the storefront objects are in the
magasinnamespace: thevitrineDeployment, thevitrineService, thevitrine-configConfigMap and thevitrine-secretSecret. None is created indefault. - The
vitrineDeployment has three available replicas. - The
MESSAGE_ACCUEILvariable, which holdsBienvenuein the container, comes from thevitrine-configConfigMap. - The
DB_PASSWORDvariable, which holdsBoutique-2026in the container, comes from thevitrine-secretSecret, and the password never appears in clear in the Deployment. - The
vitrineService counts three ready endpoints and answers over HTTP athttp://vitrine.magasinfrom a Pod of the cluster. - The storefront runs the next version: its three replicas are available on the new image, and the old ReplicaSet is kept at zero replicas.
How do you start the challenge and get graded?
The lab prepares the cluster, then reads its state again when you ask for your grade. You start it with dsoxlab run k8s-challenge-relier-config-et-service. Two commands are then used: dsoxlab check k8s-challenge-relier-config-et-service tells you where you stand, requirement by requirement, as many times as you like, and dsoxlab submit k8s-challenge-relier-config-et-service returns the final result. The grade never looks at the commands you typed: the configuration and the password are read from inside a Pod.
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. Six criteria make up the grade: the namespace, the three replicas, the configuration coming from the ConfigMap, the password coming from the Secret, the Service that answers and the update that keeps the old ReplicaSet at zero.
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.
- All the storefront objects live in the
magasinnamespace, and none indefault. - The password comes from the Secret: it never appears in clear in the Deployment.
dsoxlab checkshows where you stand as often as you like;dsoxlab submitreturns the result.