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

Choose the right workload

By updated

Improve this page

Logo Kubernetes

This challenge checks that you can, on your own, choose the right type of object for three needs that the statement describes without naming any object: a database whose replicas keep their identity and their data, an agent present on every node, and a custom resource whose schema imposes a bound. It is meant for people who have just followed the five lessons listed below. It runs in a dsoxlab virtual machine, on a kind cluster with Kubernetes 1.37, and takes about 50 minutes. It gives no hints and teaches nothing new: it checks what the lessons of the module have already let you practice.

What you will learn

The lab reads the Pods, the names they carry, their volumes, the nodes where they run and the custom resource. It checks that you can:

  • Choose and deploy a database with three ordered replicas, each with a stable identity.
  • Make each replica reachable by a stable name.
  • Give each replica its own volume, and check that its data survives the deletion of its Pod.
  • Run an agent as one copy on every node, control plane included, without removing the control plane taint.
  • Install a custom resource, create a valid instance of it and have an out-of-range value refused.

What should you be able to do before you start?

No step-by-step guide goes with the challenge, and choosing the right type of object is part of what it checks. Everything it asks is taught in five lessons:

If one of these points feels unclear, reread the lesson before you start.

What does the statement ask for?

The shop's warehouse has three needs to serve in the entrepot namespace, empty for now. You are connected with kubectl configured on the kind cluster multi, which has one control plane and two workers. The requirements describe each need; it is up to you to choose the type of object that serves it. The ~/entrepot/ directory holds the definition of a custom resource, collecte-crd.yaml, that nobody has installed yet. The database and the agent use the image busybox:1.38.0@sha256:a46257e06c82ad85242d0d38077d0a52d9896389ca60a1a59d3463db586e5fa4.

The statement says what must be true at the end, never how to get there:

  1. The inventaire database runs three replicas with a stable identity, created in order and named inventaire-0, inventaire-1 and inventaire-2, all Ready.
  2. Each replica is reached by a stable name of the form inventaire-N.<service>, served by a Service without a cluster address.
  3. Each replica has its own volume, mounted on /data. The file /data/marque of replica 1 holds inventaire-1 on its first line. You delete the inventaire-1 Pod: the recreated Pod reads this file again intact. This requirement is blocking.
  4. The collecteur agent runs as one copy on every node, and each copy is Ready.
  5. The control plane node keeps its taint: the agent runs there because it tolerates it, not because the taint was removed. This requirement is blocking.
  6. The Collecte custom resource is installed and Established. The journaux Collecte, in entrepot, targets /var/log, collects every 60 seconds and keeps 30 days, nothing more. This requirement is blocking.
  7. The API refuses any Collecte kept for more than 90 days. The file provided does not enforce it yet.

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-choisir-le-bon-workload. Two commands are then used: dsoxlab check k8s-challenge-choisir-le-bon-workload tells you where you stand, requirement by requirement, as many times as you like, and dsoxlab submit k8s-challenge-choisir-le-bon-workload returns the final result. The grade never looks at the commands you typed: it reads the cluster.

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 seven requirements weigh the same: seven met give 100, six give 86, five give 71. Requirements 3, 5 and 6 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 those in the list at the start, 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 3, 5 and 6 are blocking: the data of replica 1 read again intact, the control plane taint kept and tolerated, and the journaux Collecte matching.
  • The statement describes needs, not objects: choosing the type of object is part of what is graded.
  • dsoxlab check shows where you stand as often as you like; dsoxlab submit returns the result.