In Virtual Service, if I specify 2 destinations, they will get round-robined, or weight-based traffic.
Is there a way to do active-passive. meaning, always send traffic to dest 1, but if dest 1 is down, send it to dest 2.
Can I achieve this by specifying weight for dest 1 to 100, and 0 for dest 2?
Hi @ibmdcb
AFAIK in VirtualService Routing rules are evaluated in sequential order from top to bottom.
The highest priority which is defined first if some how the first one is unavailable or down then second one would call. See this
Istio / Traffic Management
Rules are in sequential order. But each rule, you can have more than 1 destinations. For these destinations, you can specify weight. But what if instead of a static ratio, Iād like them to be active-passive?
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v1
weight: 75
- destination:
host: reviews
subset: v2
weight: 25
Not sure may be active-passive would not supported. i searched this everywhere i found weght-based. see this
Istio / Virtual Service
also
https://github.com/istio/api/blob/2ce8d6344d2010354afd51e030136412fa86df2d/networking/v1beta1/virtual_service.pb.go#L700
if i would find something then i will tell you.
1 Like