Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Necessity for separate VirtualService and DestinationRule configs in Istio

In Istio, I was wondering why VirtualService and DestinationRule are separated into two separate config files? AFAICT, the DestinationRule defines the subset and the VirtualService routes to the subset. Obviously, they both do more than just that, but my question is, what could have been the design thought behind separating the two. Why couldn't we have defined the subset in the VirtualService yaml itself?

A follow-on question is: Why is the circuit-breaker rules configured in the destination rule, while the timeouts and retries are configured in the VirtualService? Again, I guess, I am unable to comprehend the reasoning behind this design decision. If that is clear, both questions may be answered simultaneously. Any help in understanding this conceptually will be much appreciated.

like image 439
Uba Avatar asked Aug 09 '18 17:08

Uba


1 Answers

They were designed to provide a clear separation of routing from post-routing behaviors.

A VirtualService is used to describe the mapping (route rules) from one or more user-addressable destinations (hosts) to the actual destination workloads (services) inside the mesh.

A DestainationRule then defines the set of policies to be applied to a request after VirtualService routing has occurred. They are intended to be authored by service owners, describing the circuit breakers, load balancer settings, TLS settings, etc.

An overview of how they work is here.

like image 99
Frank B Avatar answered Oct 21 '22 11:10

Frank B