Interview › Istio & Service Mesh
How do you do weighted traffic splitting for a canary release in Istio?
Istio & Service Mesh · Basic level
Answer
Weighted traffic splitting is done with a VirtualService that sends percentages of traffic to different DestinationRule subsets. For a canary, I might route 95 percent to v1 and 5 percent to v2, observe metrics, then gradually increase v2.
Technical explanation
The DestinationRule defines subsets such as v1 and v2 based on pod labels.
The VirtualService assigns integer weights to each subset, and the weights should add up to 100.
Canary decisions should be based on error rate, latency, saturation, and business metrics rather than time alone.
Hands-on example
Canary example:
http:
- route:
- destination:
host: checkout
subset: stable
weight: 95
- destination:
host: checkout
subset: canary
weight: 5Watch:
$ kubectl -n istio-system port-forward svc/prometheus 9090Query istio_requests_total and request duration by destination_version.
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 the difference between an Istio ingress gateway and an egress gateway?
- How do you implement a blue-green deployment using Istio?
- What is a Gateway resource, and how does it differ from a Kubernetes Ingress?
- What are subsets in a DestinationRule, and how are they used?
- What is a DestinationRule, and how does it relate to a VirtualService?
- How does Istio do request routing based on headers or paths?
- What is a VirtualService, and what does it control?
- What is fault injection in Istio, and why would you use it?