Bird
0
0

An Ingress rule has this path:

medium📝 Troubleshoot Q7 of 15
Kubernetes - Ingress
An Ingress rule has this path:
- path: /store
  backend:
    service:
      name: store-service
      port:
        number: 80
But requests to '/storefront' are routed to 'store-service'. Why?
APort number must be a string, not a number
BIngress path matching is prefix-based by default, so '/store' matches '/storefront'
CThe service name is incorrect
DIngress matches exact paths only, so this is a bug
Step-by-Step Solution
Solution:
  1. Step 1: Understand default path matching

    Ingress path matching is prefix-based by default, so '/store' matches any path starting with '/store'.
  2. Step 2: Apply to '/storefront'

    Since '/storefront' starts with '/store', it routes to 'store-service'.
  3. Final Answer:

    Ingress path matching is prefix-based by default, so '/store' matches '/storefront' -> Option B
  4. Quick Check:

    Ingress uses prefix matching by default [OK]
Quick Trick: Ingress paths match prefixes unless specified otherwise [OK]
Common Mistakes:
  • Expecting exact path matching
  • Assuming service name or port error
  • Confusing port number type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes