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

Repair and audit the Cilium network

By updated

Improve this page

Logo Kubernetes

This challenge checks that you can, on your own, repair, filter, route out and audit the flows of a Cilium cluster that runs without kube-proxy. It is meant for people who have just followed the Advanced networking module, starting from the lesson Send a Pod's traffic out through an egress gateway. It runs in a dsoxlab virtual machine, on a Cilium cluster with Kubernetes 1.37, and takes about 60 minutes. It gives no hints and teaches nothing new: it checks what the lessons of the module and their guided labs have already let you practice.

What you will learn

The lab reads the cluster, never your files. It queries a Service from a Pod, makes real connections, creates a new Pod and reads the log of a witness server, then compares your ConfigMap with the flows Hubble marks as refused. It checks that you can:

  • Make a Service answer again without reinstalling kube-proxy, which Cilium replaces.
  • Open a single flow between two namespaces, leaving everything else refused.
  • Route a namespace's traffic out through a chosen node, including for a Pod created after your change.
  • Name the flow a policy still refuses, with its source Pod, its destination Pod and its port.

What should you be able to do before you start?

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

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

What does the statement ask for?

You take over the Cilium cluster of the net-* hosts: a control plane, net-cp.lab, and two workers, net-w1.lab and net-w2.lab. It runs without kube-proxy: Cilium 1.20.5 replaces it. Hubble is on, and the Cilium egress gateway is already enabled. Cilium 1.20.5 declares support for Kubernetes 1.33 to 1.36, and this cluster runs 1.37.

The previous team leaves four open issues:

  • In the namespace catalogue, the Service catalogue no longer answers from the Pod client. The Pods of the Deployment catalogue do run, though. Someone suggests reinstalling kube-proxy.
  • The namespace commandes refuses all inbound traffic, through the NetworkPolicy refus-par-defaut. The Pod panier of the namespace boutique must now reach the Service stock on port 80. The Pod robot, in the same namespace, must not.
  • The network team accepts traffic from the namespace facturation to its witness server only if it comes from the address of net-w2.lab. The witness URL is in the ConfigMap temoin of facturation. The witness logs every request, with the source address it sees.
  • In the namespace paiement, three clients call the api every two seconds. One of them complains: the API no longer answers it. Nobody knows which one, or why.

You work on net-cp.lab, with kubectl and helm configured and root rights through sudo. Install and uninstall nothing.

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

  1. The Service catalogue answers again from the Pod client, with the page that the Pods of the Deployment catalogue serve. kube-proxy stays absent, and Cilium still replaces it.
  2. panier reaches stock on port 80. robot, and any Pod of another namespace, stay refused.
  3. The traffic of the namespace facturation to the witness leaves through net-w2.lab: the witness log records the address of that node. This holds for any Pod of the namespace, including a Pod created after your change. The other namespaces still leave through their own node.
  4. A ConfigMap flux-refuse, in paiement, names the refused flow with three keys: source (the client Pod), destination (the called Pod) and port (the destination port). The flow must stay refused: you name it, you do not open it.

How do you start the challenge and get graded?

You start the lab with dsoxlab run k8s-challenge-reseau-avance: it puts you in the situation described above. Two commands are then used. dsoxlab check k8s-challenge-reseau-avance lists the criteria that are not met and gives the grade, and dsoxlab submit k8s-challenge-reseau-avance returns the final result. The grade never looks at the commands you typed or at your files: the lab queries the Service from client, makes real connections from panier, robot and a Pod of another namespace, creates a new Pod in facturation itself and reads the witness log, then compares your ConfigMap with the flows Hubble marks DROPPED in the last two minutes.

Put it into practice

This lab is the challenge itself. It puts you in front of the situation described above and it reads 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. Four requirements of equal weight make up the grade, in the order of the statement: you therefore need at least three out of four.

If a requirement is not met, dsoxlab check gives the label of the criterion without saying how to fix it. Reread the lesson that covers its subject, fix it, 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.
  • You need at least three requirements out of four to reach the pass mark of 70 points out of 100.
  • The egress gateway must cover the whole namespace, including a Pod created after your change: the lab creates a new one.
  • The refused flow is named without being opened: the policy stays in place.
  • dsoxlab check lists the criteria that are not met; dsoxlab submit returns the result.