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

Bring a broken application and its cluster back into service

By updated

Improve this page

Logo Kubernetes

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:

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:

  1. The api Deployment has its two replicas available.
  2. No api Pod restarts in a loop any more.
  3. api reads its configuration where the team's convention puts it: the APP_CONFIG_PATH variable is /etc/config, the application really finds its app.conf file there, and it answers on its port.
  4. The vitrine Pod runs a public nginx image, really pulled by the node, and answers in HTTP.
  5. Before repairing a failure, you write its cause in a file of ~/incident/, one per failure: api.txt, vitrine.txt, apiserver.txt and kubelet.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.
  6. The API server answers again, and its Pod runs without restarting in a loop. This requirement is blocking.
  7. Its manifest no longer carries the faulty flag, and still authorizes requests with Node,RBAC.
  8. k8s-w1.lab is Ready, and its kubelet runs with a valid configuration that keeps the address of the cluster DNS.
  9. The kubelet of the worker is active, and will start again after a reboot of the machine.
  10. entrepot has its three replicas available again, on k8s-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 check lists the unmet criteria; dsoxlab submit returns the result.