Skip to main content
DestinationRules in Istio enable advanced traffic management for services. They define subsets used for traffic splitting, configure load balancing and connection pools, enable circuit breaking and outlier detection, and set client TLS modes. In this guide we’ll walk through a common workflow: deploying two versions of a HelloWorld service, defining subsets via a DestinationRule, and splitting traffic with a VirtualService.

Prerequisites

Verify Istio sidecar injection is enabled for your namespace(s):
Example output:
Namespaces must be labeled for Istio sidecar injection (or the pods must have the sidecar injected) for VirtualService/DestinationRule routing to take effect across namespaces.

Deploy the HelloWorld sample (v1 and v2)

Deploy two versions of a HelloWorld application (v1 and v2). Confirm the pods are running and each pod shows 2/2 (application container + Envoy sidecar):
Example output:
Inspect the service and pod labels — DestinationRule subsets will match pod labels (for example version: v1 and version: v2):
Example abbreviated output:

Create a test namespace and test client

Create a separate namespace for testing and enable Istio injection there. VirtualService/DestinationRule behavior depends on whether the communicating namespaces have sidecar injection enabled.
Run a simple test pod in the test namespace (a lightweight curl image that stays running so you can exec into it):
Example:
Exec into the test pod (or run a one-off command) to curl the HelloWorld service in the default namespace:
With no Istio routing yet, responses will be balanced by Kubernetes/Envoy defaults and you should see responses from either v1 or v2.

Create a DestinationRule (subsets)

DestinationRules declare subsets that map to pod labels. Create a DestinationRule for the helloworld host that defines v1 and v2 subsets:
Apply the DestinationRule and confirm it’s created:
Example output:
Note: A DestinationRule alone does not split traffic; subsets simply define targets. You need a VirtualService to route between those subsets.

Create a VirtualService to split traffic

Create a VirtualService that references the subsets declared in your DestinationRule. This example splits traffic 50/50 between v1 and v2:
Apply the VirtualService and verify it exists:
Example output:

Test the routing

From the test pod, run several requests to observe traffic being split between v1 and v2:
Example responses:

Adjust weights for traffic distribution

To change the split, update the weight fields in the VirtualService. For example, to route 95% to v1 and 5% to v2, modify the route section:
Apply the updated VirtualService:
Re-run the curl loop in the test pod; you should observe mostly v1 responses. View the final resource files for reference:

DestinationRule features (summary)

DestinationRules cover multiple traffic-management concerns. Use the table below as a quick reference.

Example DestinationRule snippets

Connection pool example (TCP):
Load-balancer and subset-specific trafficPolicy:
Outlier detection / circuit breaker:
Client TLS (MUTUAL):
Client TLS (SIMPLE):
Client TLS (Istio mTLS for ratings service):
The image shows a webpage from Istio documentation detailing the TLS connection modes, with a table outlining different modes such as DISABLE, SIMPLE, MUTUAL, and ISTIO_MUTUAL alongside their descriptions.

Next steps and practice tips

  • Practice creating subsets and VirtualServices that reference those subsets to get comfortable with weight-based splitting.
  • Experiment with trafficPolicy fields (connectionPool, loadBalancer, outlierDetection) to observe their operational effects.
  • Use different TLS modes when securing connections between services and test with mutual TLS where appropriate.
References

Watch Video

Practice Lab