Challenge Easy

Troubleshoot an Ingress That Returns 404 Not Found

An nginx Deployment runs fine, but its address returns an error. Trace the path from the Ingress to the Pod and fix the manifests.

Scenario

The bose-einstein Deployment runs nginx in the physics namespace. It is exposed through the bose-einstein Ingress at http://bose.physics.local, but the address returns 404 page not found.

nginx in the Pods is healthy and listens on port 9090. The files the team applied are on cplane-01. Only ingress.yaml and service.yaml are misconfigured. Do not change the other files:

/home/laborant/bose-einstein/
├── default.conf      # do not change
├── deployment.yaml   # do not change
├── index.html        # do not change
├── ingress.yaml      # misconfigured
└── service.yaml      # misconfigured

Task

Make the necessary changes to the misconfigured files in /home/laborant/bose-einstein/ and apply them, so that the application is reachable at http://bose.physics.local.

Important

Do not change or recreate the bose-einstein Deployment. Keep the Ingress host bose.physics.local, and do not change Traefik.


Hint 1 | Following a request from the Ingress to the Pod

A request passes through the Ingress, then the Service, then a Pod. Check each link in turn:

kubectl describe ingress <name> -n <namespace>
kubectl describe service <name> -n <namespace>
kubectl get endpointslices -n <namespace>
kubectl get pods -n <namespace> --show-labels
Hint 2 | Which port goes where

Three different fields hold a port, and each one points to the next:

FieldPoints to
Ingress backend.service.portA port of the Service
Service portThe port the Service exposes
Service targetPortThe port the container listens on

⚒ Test Cases