What do VirtualService and DestinationRule do?
⚡
Quick Answer
VirtualService defines routing rules (match/route/weight); DestinationRule defines policies for a destination (subsets, load balancing, TLS).
Detailed Answer
A VirtualService says how to route requests to a host — e.g. 90/10 canary split, header-based routing, retries, timeouts. A DestinationRule defines subsets (versions) and connection policies (load-balancing, circuit breaking) for that host. Together they enable canary and blue-green traffic shaping.
Code Example
http:
- route:
- destination: { host: app, subset: v1 }
weight: 90
- destination: { host: app, subset: v2 }
weight: 10💡
Interview Tip
VirtualService = routing, DestinationRule = subsets/policy.
istiovirtualservicerouting