Challenge - 5 Problems
Path-based Routing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of path-based routing Ingress configuration
Given the following Kubernetes Ingress YAML snippet, what will be the backend service receiving traffic for the path
/app1?Kubernetes
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
rules:
- http:
paths:
- path: /app1
pathType: Prefix
backend:
service:
name: service-app1
port:
number: 80
- path: /app2
pathType: Prefix
backend:
service:
name: service-app2
port:
number: 80Attempts:
2 left
💡 Hint
Look at the path and backend service mapping in the Ingress spec.
✗ Incorrect
The path /app1 is explicitly routed to service-app1 on port 80 as per the Ingress rules.
❓ Configuration
intermediate1:30remaining
Correct pathType for prefix matching in Ingress
Which
pathType value should be used in a Kubernetes Ingress to route all requests starting with /api to a backend service?Attempts:
2 left
💡 Hint
Consider which pathType matches all paths starting with the given prefix.
✗ Incorrect
The 'Prefix' pathType matches all requests that start with the specified path prefix.
❓ Troubleshoot
advanced2:30remaining
Why does traffic to /app not route correctly?
A user configured this Ingress snippet but traffic to
/app returns 404. What is the most likely cause?Kubernetes
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: test-ingress
spec:
rules:
- http:
paths:
- path: /app/
pathType: Exact
backend:
service:
name: app-service
port:
number: 80Attempts:
2 left
💡 Hint
Check how Exact pathType matches requests.
✗ Incorrect
Exact pathType requires the request path to exactly match /app/, so /app (without trailing slash) returns 404.
🔀 Workflow
advanced2:00remaining
Order of path matching in Kubernetes Ingress
In which order does Kubernetes Ingress controller evaluate multiple path rules for routing?
Attempts:
2 left
💡 Hint
Think about how more specific paths should be matched before less specific ones.
✗ Incorrect
Ingress controllers match the longest path prefix first to ensure specific routes take precedence.
✅ Best Practice
expert3:00remaining
Best practice for path-based routing with overlapping paths
You have two Ingress paths:
/app and /app/v2. What is the best practice to ensure traffic to /app/v2 goes to the correct backend without conflict?Attempts:
2 left
💡 Hint
Consider how path matching order affects routing when paths overlap.
✗ Incorrect
Defining the more specific path /app/v2 before /app ensures it matches first and routes correctly.