This challenge checks that you can, on your own, diagnose and repair several failures that hit a kubeadm cluster at the same time: an application that restarts in a loop, a Pod that does not start, a silent API server and a worker that has left the cluster. It is meant for people who have just followed the lesson Troubleshoot a Kubernetes node: kubelet and NotReady of the Diagnose an incident module. It runs in a dsoxlab virtual machine, on a kubeadm cluster with Kubernetes 1.37, and takes about 60 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 reads the state of the cluster, the services and the files of the nodes, as well as the date of your incident notes. It checks that you can:
- Repair a Deployment whose Pods restart in a loop, and make it read its configuration where it is asked to.
- Repair a Pod whose image cannot be pulled.
- Bring back an API server whose static Pod no longer starts.
- Bring back a worker whose kubelet is down, durably, and find the application reserved for it.
- Write the cause of each failure before repairing it, from what you read in the events and the logs.
What should you be able to do before you start?
No step-by-step guide goes with the challenge, and choosing the right method is part of what it checks. What the challenge asks for is taught in seven lessons:
- Troubleshoot a Kubernetes node: kubelet and NotReady to read a
NotReadynode and repair its kubelet; - Kubernetes Incident Diagnosis Method to decide where to look;
- Analyze Kubernetes events with kubectl events to read what the cluster reports;
- Diagnose a Kubernetes CrashLoopBackOff for an application that restarts in a loop;
- Diagnose a Kubernetes ImagePullBackOff for a Pod whose image cannot be pulled;
- Diagnose a Kubernetes control plane failure for an API server that no longer answers;
- Check Kubernetes cluster health with 5 commands to check that everything is back.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
It is Monday, 8 a.m. Over the weekend, several people "fixed things" on the shop's kubeadm cluster, and this morning nothing works. In the commerce namespace, the api application restarts in a loop and the vitrine Pod never starts. kubectl gets no answer any more. The worker k8s-w1.lab has left the cluster, and the entrepot application, which is reserved for it, went down with it. You are on the control plane, and ssh k8s-w1.lab opens a session on the worker.
The statement says what must be true at the end, never how to get there:
- The
apiDeployment has its two replicas available. - No
apiPod restarts in a loop any more. apireads its configuration where the team's convention puts it: theAPP_CONFIG_PATHvariable is/etc/config, the application really finds itsapp.conffile there, and it answers on its port.- The
vitrinePod runs a public nginx image, really pulled by the node, and answers in HTTP. - Before repairing a failure, you write its cause in a file of
~/incident/, one per failure:api.txt,vitrine.txt,apiserver.txtandkubelet.txt. The cause comes from what you read (describe, the events, the logs): it names what is wrong, and not only the status Kubernetes shows. Do not touch these files afterwards: their date is compared with the start of what was repaired. This requirement is blocking. - The API server answers again, and its Pod runs without restarting in a loop. This requirement is blocking.
- Its manifest no longer carries the faulty flag, and still authorizes requests with
Node,RBAC. k8s-w1.labisReady, and its kubelet runs with a valid configuration that keeps the address of the cluster DNS.- The kubelet of the worker is active, and will start again after a reboot of the machine.
entrepothas its three replicas available again, onk8s-w1.lab.
The repairs are made on what describes the application or the node (the Deployment, the manifest, the configuration of the service). Removing what is in the way repairs nothing: fewer replicas, a deleted line or an application moved to another node do not count.
How do you start the challenge and get graded?
The lab prepares the cluster and its failures, then reads its state again when you ask for your grade. You start it with dsoxlab run k8s-challenge-depanner-une-application. Two commands are then used: dsoxlab check k8s-challenge-depanner-une-application tells you where you stand, criterion by criterion, as many times as you like, and dsoxlab submit k8s-challenge-depanner-une-application returns the final result. The lab never looks at the commands you typed: it reads the cluster through its API, the state of the services, the files of the nodes and the date of your files in ~/incident/.
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 ten requirements weigh the same. Requirements 5 and 6 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 covers that failure, fix it, then run dsoxlab check again. The lesson Troubleshoot a Kubernetes node: kubelet and NotReady covers the kubelet and the application reserved for the node, and Diagnose a Kubernetes control plane failure covers the API server.
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 5 and 6 are blocking: the causes written before each repair, and the API server back in service.
- A repair touches what describes the application or the node; removing what is in the way does not count.
dsoxlab checklists the unmet criteria;dsoxlab submitreturns the result.