Interview › Istio & Service Mesh
How does Istio do request routing based on headers or paths?
Istio & Service Mesh · Basic level
Answer
Istio routes by matching request attributes in a VirtualService. For HTTP traffic, it can match URI prefixes or exact paths, methods, headers, query parameters, gateways, ports, and source labels, then route to a destination subset or service.
Technical explanation
Header-based routing is useful for internal testers, beta users, or requests carrying a specific release header.
Path-based routing is common at ingress gateways for routing /api, /admin, or /static to different backends.
Match rules are evaluated in order, so specific rules should come before general catch-all routes.
Hands-on example
Header route example:
match:
- headers:
x-canary-user:
exact: 'true'
route:
- destination:
host: checkout
subset: canary
Then test:
$ curl -H 'x-canary-user: true' https://app.example.com/checkout
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Istio & Service Mesh interview questions
- What is Istio, and what are the core capabilities it provides?
- What is the difference between the Istio control plane and data plane?
- What is istiod, and what does it do?
- What is Envoy, and what role does it play in Istio?
- What is the sidecar pattern, and how does Istio inject the proxy?
- How does automatic sidecar injection work (namespace label, webhook)?
- What is the Istio ambient (sidecarless) mode, and how does it differ from sidecar mode?
- What is the difference between ztunnel and a waypoint proxy in ambient mode?