Bird
0
0

You wrote this Ingress rule but traffic to '/api' is not routed correctly:

medium📝 Troubleshoot Q14 of 15
Kubernetes - Ingress
You wrote this Ingress rule but traffic to '/api' is not routed correctly:
paths:
- path: api
  pathType: Prefix
  backend:
    service:
      name: api-service
      port:
        number: 80
What is the likely error?
AIncorrect pathType value
BService name is invalid
CMissing leading slash in path value
DPort number must be a string
Step-by-Step Solution
Solution:
  1. Step 1: Check path syntax

    Paths must start with a leading slash '/' to match URLs correctly.
  2. Step 2: Identify missing slash

    The path is 'api' instead of '/api', so it won't match requests starting with '/api'.
  3. Final Answer:

    Missing leading slash in path value -> Option C
  4. Quick Check:

    Paths need leading '/' for correct matching [OK]
Quick Trick: Always start path with '/' in Ingress rules [OK]
Common Mistakes:
  • Omitting leading slash in path
  • Using wrong pathType values
  • Assuming port number must be string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes