K8s
EscapeRoom
Back to Level Select

404: Room Not Found

beginnerImagePullBackOff

Objective

Escape Room: 404: Room Not Found

The container never even starts — something is missing before it can run.

Your Mission

  1. Identify why the container can't start
  2. Figure out what's wrong
  3. Fix the pod so it runs successfully

Success Criteria

  • The pod escape-app is in Running state
  • The nginx container is serving traffic on port 80

Getting Started

# Check the pod status
kubectl get pods -n escape-room-404-not-found

# You'll see something like:
# NAME         READY   STATUS             RESTARTS   AGE
# escape-app   0/1     ImagePullBackOff   0          2m

Namespace

All resources are in the escape-room-404-not-found namespace.

Good luck, engineer. Every second counts.

Quick Start

Run this command in your terminal to set up the room:

$ make room-apply ROOM=room-404-not-found

This creates the namespace escape-room-404-not-found with the broken resources.

Other useful commands:

$ make room-test ROOM=room-404-not-found

Verify the room is in the expected broken state

$ make room-escape-test ROOM=room-404-not-found

Test if you have successfully fixed all issues

$ make room-reset ROOM=room-404-not-found

Reset the room to try again

Useful Commands

Check pod status

$ kubectl get pods -n escape-room-404-not-found

See the current state of pods in the namespace

View events

$ kubectl get events -n escape-room-404-not-found --sort-by='.lastTimestamp'

Check recent events for error details

Describe pods

$ kubectl describe pods -n escape-room-404-not-found

Get detailed information about pods

Check logs

$ kubectl logs -l app.kubernetes.io/part-of=K8sEscapeRoom -n escape-room-404-not-found

View the application logs

Hints

0/4 revealed

Submit Proof

Login to submit proof and track your progress.

Login with GitHub
View Solution (Spoiler)

Solution preview locked

Complete the room to unlock the full solution here

Run this to see the full solution:

$ make room-solution ROOM=room-404-not-found
Show solution anyway (spoiler)

Solution: ImagePullBackOff - Invalid Image Tag

Root Cause

The pod specifies an invalid image tag: nginx:latset (typo - should be latest).

This is a very common real-world issue, often caused by:

  • Typos in manifests
  • Copy-paste errors
  • Missing or deleted image tags
  • Wrong registry URLs

Diagnosis Steps

# 1. Check pod status - see ImagePullBackOff
kubectl get pods -n escape-room-404-not-found

# 2. Describe the pod to see events
kubectl describe pod escape-app -n escape-room-404-not-found

# Look for events like:
# Events:
#   Type     Reason     Age   From               Message
#   ----     ------     ----  ----               -------
#   Normal   Scheduled  30s   default-scheduler  Successfully assigned...
#   Normal   Pulling    29s   kubelet            Pulling image "nginx:latset"
#   Warning  Failed     28s   kubelet            Failed to pull image "nginx:latset":
#                                                rpc error: manifest for nginx:latset not found
#   Warning  Failed     28s   kubelet            Error: ErrImagePull
#   Normal   BackOff    27s   kubelet            Back-off pulling image "nginx:latset"
#   Warning  Failed     27s   kubelet            Error: ImagePullBackOff

# 3. Verify the image specification
kubectl get pod escape-app -n escape-room-404-not-found -o jsonpath='{.spec.containers[0].image}'
# Output: nginx:latset

The Fix

Option 1: Quick Fix with kubectl run

# Delete the broken pod
kubectl delete pod escape-app -n escape-room-404-not-found

# Create a new pod with the correct image (using a specific version)
kubectl run escape-app -n escape-room-404-not-found \
  --image=nginx:1.25-alpine \
  --port=80

Note: We use nginx:1.25-alpine (a specific version) rather than nginx:latest. While latest works for this exercise, using specific versions is a best practice for production (see Lessons Learned).

Option 2: Apply Corrected YAML

# Delete the broken pod
kubectl delete pod escape-app -n escape-room-404-not-found

# Apply the fixed manifest
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name: escape-app
  namespace: escape-room-404-not-found
  labels:
    app: escape-app
    room: imagepullbackoff
spec:
  containers:
    - name: app
      image: nginx:1.25-alpine
      ports:
        - containerPort: 80
      resources:
        requests:
          memory: "64Mi"
          cpu: "50m"
        limits:
          memory: "128Mi"
          cpu: "200m"
EOF

Verification

# Check the pod is now running
kubectl get pods -n escape-room-404-not-found
# NAME         READY   STATUS    RESTARTS   AGE
# escape-app   1/1     Running   0          30s

# Verify nginx is responding
kubectl exec escape-app -n escape-room-404-not-found -- curl -s localhost:80 | head -5
# Or port-forward and test locally:
kubectl port-forward pod/escape-app 8080:80 -n escape-room-404-not-found &
curl localhost:8080

Lessons Learned

  1. Read the events carefully - They tell you exactly what's wrong
  2. Check image names for typos - Very common issue
  3. Use specific tags - Avoid :latest in production; use specific versions
  4. Validate manifests before applying - Use kubectl apply --dry-run=client

Real-World Prevention

In production, prevent this issue with:

# 1. Use specific image tags (not latest)
image: nginx:1.25.3

# 2. Use image digest for immutability
image: nginx@sha256:abc123...

# 3. Set imagePullPolicy appropriately
imagePullPolicy: IfNotPresent  # or Always for latest

CI/CD best practices:

  • Validate image exists before deployment
  • Use container registry webhooks
  • Implement admission controllers (e.g., Kyverno, OPA) to enforce image policies