Explains Istio DestinationRules and how they complement VirtualService by defining subsets and post-routing policies like load balancing, connection pools, outlier detection, and mTLS.
DestinationRules are as important as VirtualServices in Istio traffic management.A VirtualService intercepts incoming requests for a service and decides where that traffic should go (routing). DestinationRules complement VirtualServices by declaring how traffic should be handled once routing has selected the destination host—applying policies such as subsets, load balancing, connection pools, TLS, and outlier detection.
In short:
VirtualService: decides where traffic goes (routing rules, host selection).
DestinationRule: decides how traffic is treated for the chosen host (per-host or per-subset policies).
Why use DestinationRules?
Define subsets (e.g., v1 / v2) that map to pod labels.
Apply different traffic policies per subset or service-level policies (load balancing, connection pools, outlier detection, TLS, etc.).
Enforce mTLS for service-to-service communication.
Table — quick comparison
Config object
Primary responsibility
Common use cases
VirtualService
Routing rules, traffic splitting, match conditions
Create a VirtualService that references those subsets to split traffic 50/50. The subset field here must match the name values defined in the DestinationRule:
Ensure subset names in the VirtualService (subset: v1) exactly match the name values defined under subsets in the DestinationRule. Mismatched names cause route resolution failures.
Remember: the VirtualService decides which subset receives traffic; the DestinationRule maps those subset names to pod labels and applies the policies for traffic to those subsets.Common DestinationRule policy examples
Circuit breaking, connection pool tuning, outlier detection, and mTLS settings can also be configured per-host or per-subset in a DestinationRule.
DestinationRules can configure subsets, load-balancing strategies, connection pools, outlier detection (circuit breaking), and client TLS settings (e.g., enforcing mTLS). These policies apply after routing has selected the destination.
Additional tips
Apply manifests with kubectl apply -f <manifest.yaml> to test in your cluster.
Use istioctl analyze to validate Istio configuration and catch common pitfalls.
To debug traffic routing and policy effects, inspect Envoy proxies (istio-proxy logs) and use istioctl proxy-config commands.