Bird
0
0

You applied this VirtualService YAML but traffic is not routing as expected. What is the likely error?

medium📝 Troubleshoot Q6 of 15
Kubernetes - Service Mesh
You applied this VirtualService YAML but traffic is not routing as expected. What is the likely error?
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: myservice
spec:
  hosts:
  - myservice
  http:
  - route:
    - destination:
        host: myservice
        subset: v1
      weight: 50
    - destination:
        host: myservice
        subset: v2
      weight: 50
ADestinationRule defining subsets v1 and v2 is missing or incorrect
BVirtualService host name does not match Kubernetes service name
CWeights do not add up to 100
DVirtualService kind should be DestinationRule
Step-by-Step Solution
Solution:
  1. Step 1: Check subset definitions

    Subsets v1 and v2 must be defined in a DestinationRule for the host myservice.
  2. Step 2: Identify missing or incorrect DestinationRule

    If DestinationRule is missing or subsets are not defined, routing to subsets fails despite correct VirtualService.
  3. Final Answer:

    DestinationRule defining subsets v1 and v2 is missing or incorrect -> Option A
  4. Quick Check:

    Missing DestinationRule = routing failure [OK]
Quick Trick: Always define subsets in DestinationRule matching VirtualService [OK]
Common Mistakes:
  • Ignoring DestinationRule existence
  • Assuming weights must sum to 100 (they do, but here they do)
  • Confusing VirtualService kind

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes