Bird
0
0

You want to route 100% of traffic from users with header version: v2 to version v2 of your service, and all others to v1. Which VirtualService configuration snippet achieves this?

hard📝 Best Practice Q15 of 15
Kubernetes - Service Mesh
You want to route 100% of traffic from users with header version: v2 to version v2 of your service, and all others to v1. Which VirtualService configuration snippet achieves this?
Aroute: - destination: host: myservice subset: v1 weight: 50 - destination: host: myservice subset: v2 weight: 50
Broute: - destination: host: myservice subset: v2 weight: 100 headers: request: exact: {version: v2} - destination: host: myservice subset: v1 weight: 100
Chttp: - match: headers: version: exact: v2 route: - destination: host: myservice subset: v2 - route: - destination: host: myservice subset: v1
Dhttp: - route: - destination: host: myservice subset: v2 weight: 100
Step-by-Step Solution
Solution:
  1. Step 1: Identify header-based routing syntax

    Istio uses http with match for header conditions.
  2. Step 2: Check options for header match and routing

    http: - match: headers: version: exact: v2 route: - destination: host: myservice subset: v2 - route: - destination: host: myservice subset: v1 correctly matches header version: v2 and routes to subset v2, else routes to v1.
  3. Final Answer:

    http: - match: headers: version: exact: v2 route: - destination: host: myservice subset: v2 - route: - destination: host: myservice subset: v1 -> Option C
  4. Quick Check:

    Header match with http and route = A [OK]
Quick Trick: Use 'http' with 'match' for header-based routing [OK]
Common Mistakes:
  • Placing headers under route weight instead of match
  • Splitting traffic by weight instead of header
  • Omitting 'http:' block for routing rules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes