This challenge checks that you can, on your own, keep an application available while a node is drained, then describe the state of the cluster in a routine report. It is meant for people who have just followed the lesson Kubernetes operations routine: daily, weekly and monthly of the Make reliable and operate module. It runs in a dsoxlab virtual machine, on a kubeadm cluster with Kubernetes 1.37, and takes about 45 minutes. It gives no hints and teaches nothing new: it checks what the lessons and their guided labs have already let you practice.
What you will learn
The lab acts on the cluster and reads the state of the application, of the nodes and of the report. It checks that you can:
- Run an application in several available copies.
- Protect the application with a single disruption budget (PodDisruptionBudget) that guarantees a minimum of copies while still allowing a maintenance.
- Spread the copies over different nodes with a rule declared in the description of the application.
- Declare readiness and liveness probes, so that a copy only receives traffic once it is ready.
- Write a routine report that describes the nodes, the Pods in error, the finished Jobs that remain and the expiry date of the certificates.
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. What the challenge asks for is taught in five lessons:
- Kubernetes operations routine: daily, weekly and monthly for the routine and its report;
- Make Kubernetes applications reliable in production for the probes and the spreading of the copies;
- Guarantee application availability on Kubernetes for the disruption budget;
- Prepare a Kubernetes cluster maintenance to drain a node without interrupting the application;
- Manage Kubernetes cluster nodes day to day to drain a node and bring it back into service.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
The paiement application, in the paiement namespace of the kubeadm cluster, takes the shop's payments behind its Service, also named paiement. It runs today as a single copy, and the next maintenance of the worker k8s-w1.lab is planned for tonight. Nobody wants payments to stop during it. On port 80, /vivant.html answers as soon as the process runs. The application then takes about twenty seconds to start up, and until then / does not serve its page. /pret.html only answers once the start-up is over.
The operations lead also wants the routine report that the morning team reads. It is an observation: what it reports belongs to other teams, and you change nothing of it. You are on the control plane, with kubectl configured.
The statement says what must be true at the end, never how to get there:
paiementruns in at least three available copies.- A disruption budget targets the
paiementPods and guarantees at least two available copies in all circumstances, while still allowing a maintenance. This requirement is blocking. - The copies are spread over different nodes, as many as the cluster can offer, by a rule declared in the description of the application.
- The readiness and liveness probes are declared, and a copy only receives traffic once it is ready: never while it is starting up.
- While a node is drained,
paiementkeeps at least two available copies, and the drain completes. This requirement is blocking. - The file
~/routine/rapport.txtreports, as the cluster really is, the nodes (each by its name), the Pods in error (each by its name or by the name of what manages it), the orphan resources (the finished Jobs that remain) and the expiry date of the control plane certificates, askubeadmoropensslshow it, or writtenYYYY-MM-DD.
How do you start the challenge and get graded?
The lab prepares the cluster, then acts on it when you ask for your grade. You start it with dsoxlab run k8s-challenge-garantir-la-disponibilite. Two commands are then used: dsoxlab check k8s-challenge-garantir-la-disponibilite tells you where you stand, criterion by criterion, as many times as you like, and dsoxlab submit k8s-challenge-garantir-la-disponibilite returns the final result. Every check acts on the cluster: it evicts one copy of paiement to see whether its replacement receives traffic before it is ready, then it drains k8s-w1.lab itself, counts the available copies during the drain, puts the node back into service and spreads the copies again. The report is compared with the state of the cluster at the time of the check.
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 points out of 100. The six requirements weigh the same. Requirements 2 and 5 are blocking: if one of the two is not met, the challenge fails, whatever the total. dsoxlab check lists the unmet criteria, by their label, with the grade: no message says why.
If a criterion resists, reread the lesson that teaches it, fix it, then run dsoxlab check again. The lesson Make Kubernetes applications reliable in production covers the probes and the spreading, and Kubernetes operations routine: daily, weekly and monthly covers the report.
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 2 and 5 are blocking: the budget that guarantees the minimum, and the minimum kept during the drain.
- Every check acts on the cluster and drains
k8s-w1.lab: do not rundsoxlab checkon a cluster that other people are using. dsoxlab checklists the unmet criteria;dsoxlab submitreturns the result.