Challenge
DifficultyHard
Learner activity128 solved of 220 attempts

Troubleshoot a Website That Is Not Accessible

Omkar Shelke
by  Omkar Shelke · on
Kubernetes
A web application runs in Kubernetes, but its website does not open. Follow the path of a request from the NodePort to the application, fix every place where it breaks, and make sure that the Deployment describes the application correctly.

Scenario

The Northwind Books online catalog runs in the bookshop namespace of a Kubernetes cluster. After the last deployment, the Pods are running, but the website does not open.


Task

Find out why the website is not accessible and fix it. Make sure that the Deployment describes the application correctly. Keep the existing health checks.

When you are done, check the website:

curl http://cplane-01:30333
Important

Fix the problem with changes to the Deployment and the Service only. Leave all other objects as they are.

The environment may need up to 1 minute to set up.


Hint 1: When a Pod is ready

A Pod that runs is not always ready. The kubelet runs the container's readiness probe, and the Pod receives traffic from a Service only after the probe passes. kubectl describe pod shows the probe and the events of its failures. Keep the probe, and make it check the port nginx serves.

Documentation

Hint 2: What the container listens on

The Deployment manifest does not decide the port nginx listens on. The application's own configuration does. Look at the files mounted into the nginx container. Every object that sends a request to nginx must use this port.

Documentation

Hint 3: Where the traffic goes

A Service sends traffic only to the ready Pods listed in its endpoints. Check whether bookshop-service has any endpoints. If it has none, compare how the Service selects Pods with the labels the Pods actually carry. Then check which port the endpoints point to.

Documentation

Hint 4: What the Deployment tells others

People and tools read the ports that a container declares in the Pod template. kubectl describe prints them, and kubectl expose copies them into a new Service. Compare the declared port with the port you found in Hint 2.

Documentation


âš’ Test Cases

Problem
Solution
Start
Black Friday