Bird
0
0

What will happen if you add this annotation to an Ingress?

medium📝 Command Output Q5 of 15
Kubernetes - Ingress
What will happen if you add this annotation to an Ingress?
nginx.ingress.kubernetes.io/rewrite-target: "/newpath"
AThe Ingress will reject requests not matching "/newpath"
BThe backend service will be changed to "/newpath"
CRequests matching the Ingress path will be rewritten to "/newpath" before forwarding
DThe Ingress controller will disable path matching
Step-by-Step Solution
Solution:
  1. Step 1: Understand rewrite-target annotation

    This annotation changes the request path sent to the backend by rewriting it to the specified target.
  2. Step 2: Apply the effect of rewriting to "/newpath"

    Requests matching the Ingress path will have their path replaced with "/newpath" before reaching the backend.
  3. Final Answer:

    Requests matching the Ingress path will be rewritten to "/newpath" before forwarding -> Option C
  4. Quick Check:

    rewrite-target changes request path [OK]
Quick Trick: rewrite-target changes request path sent to backend [OK]
Common Mistakes:
  • Thinking it blocks unmatched requests
  • Assuming backend service changes
  • Believing path matching is disabled

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes