This challenge checks that you can, on your own, expose two applications by host and path, repair a Service that leads nowhere and a Pod that resolves no name, then isolate a database so that only its backend can reach it, without cutting its name resolution. It is meant for people who have just followed the six lessons listed below. It runs in a dsoxlab virtual machine, on a kubeadm cluster with Kubernetes 1.37, Traefik and Calico, 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 reads the state of the cluster and replays real requests. It checks that you can:
- Route two applications by host and path with an Ingress or an HTTPRoute, and check that its controller has taken it over.
- Repair a Service with no endpoints by targeting the port where the container really listens.
- Make a Pod resolve the name of a Service through the cluster DNS.
- Set a default-deny NetworkPolicy, inbound and outbound, on a single Pod.
- Allow only the backend to reach the database, and refuse the frontend and a Pod from another namespace.
- Keep name resolution working for the database despite the default refusal.
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. Everything it asks is taught in six lessons:
- Kubernetes Ingress: route HTTP paths to Services with Traefik;
- Kubernetes Gateway API: the same route with a Gateway and an HTTPRoute, and how to diagnose it;
- Kubernetes Services: link a Service to its Pods with a selector and a port;
- Pod Networking: understand how one Pod reaches another;
- CoreDNS: resolve a Service name through the cluster DNS;
- Kubernetes NetworkPolicies: deny by default, allow only one precise flow and reopen DNS. Its two guided labs,
cka-networkpolicy-isolate-dbandckad-networkpolicy-ingress-egress, let you practice these steps.
If one of these points feels unclear, reread the lesson before you start.
What does the statement ask for?
On the catalogue's kubeadm cluster, the comptoir team has deployed everything in the namespace of the same name, but nothing is exposed or protected. Two applications, catalogue and panier, each answer behind their Service. A legacy Service, ancien, leads nowhere. The sonde Pod resolves no name. The database, the base Pod, accepts everyone, including the rodeur Pod of the voisinage namespace. The cluster provides a Traefik controller, reachable on port 30080 of the node, which serves Ingresses of class traefik as well as Gateways of class traefik. Calico enforces the NetworkPolicies there.
The requirements say what must be true at the end, never how to get there:
- For the host
comptoir.local, the path/cataloguereaches thecatalogueapplication and the path/panierthepanierapplication. An undeclared path, or another host, reaches neither. This requirement is blocking. - This route is named
vitrine. It is an Ingress or an HTTPRoute, your choice, and its controller has taken it over: the Ingress carries an address, or the Gateway of the HTTPRoute is programmed and has accepted it. - The
ancienService has endpoints: the Pods of theancienDeployment, reached on the port their container really listens on. - The
sondePod resolves the name of thecatalogueService through the cluster DNS, and reaches it over HTTP by its short name. This requirement is blocking. - A
base-refus-par-defautNetworkPolicy sets a default refusal, inbound and outbound, on thebasePod and on it alone. It allows nothing itself. - On port 5432 of the database, the
backendPod gets in. ThefrontendPod is refused, and so isrodeur, although it carries the same label asbackend. This requirement is blocking. - The database still resolves names despite the default refusal, and reaches nothing else.
How do you start the challenge and get graded?
The lab prepares the cluster and the namespaces, then reads the state of the cluster again when you ask for your grade. You start it with dsoxlab run k8s-challenge-exposer-et-isoler. Two commands are then used: dsoxlab check k8s-challenge-exposer-et-isoler tells you where you stand, requirement by requirement, as many times as you like, and dsoxlab submit k8s-challenge-exposer-et-isoler returns the final result. The grade never looks at the commands you typed: it reads the state of the cluster and replays real connections.
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 requirements met give 100, six give 86 and five give 71. Requirements 1, 4 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, in the list of the prerequisites section, 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 1, 4 and 6 are blocking: the routed paths, the name resolution from
sonde, and database access reserved to the backend. - The route is named
vitrine, and it is up to you to choose between an Ingress and an HTTPRoute. dsoxlab checkshows where you stand as often as you like;dsoxlab submitreturns the result.