Member-only story
Understanding Istio Traffic Routing: Gateways, VirtualServices, and DestinationRules
👉 if you’re not a Medium member, read this story for free, here.
When working with Kubernetes, controlling traffic between services can get complicated. That’s where Istio comes in — it gives you fine-grained control over traffic inside and outside your cluster.
In this article, we’ll focus on three key Istio resources:
- Gateways — control inbound traffic from outside the cluster
- VirtualServices — define how traffic is routed inside the mesh
- DestinationRules — configure policies for traffic to specific service versions
Let’s break them down with a simple example and YAML snippets.
Scenario: You Have a Sample App with Two Versions
Imagine you have a service called my-app
running two versions (v1
and v2
). You want to:
- Allow external HTTP traffic to reach your app
- Route 80% of traffic to
v1
and 20% tov2
- Enable connection policies like timeouts or TLS later on
We’ll do that using a Gateway, a VirtualService, and a DestinationRule.