Interview › Istio & Service Mesh
What is a DestinationRule, and how does it relate to a VirtualService?
Istio & Service Mesh · Basic level
Answer
A DestinationRule defines policies for traffic after routing has selected a service destination. It commonly declares subsets, load-balancing behavior, connection-pool limits, TLS mode, and outlier detection. VirtualService chooses where traffic goes; DestinationRule defines how traffic behaves at that destination.
Technical explanation
Subsets map logical labels such as v1 and v2 to workload labels on pods.
Traffic policies can be global for a host or overridden per subset.
Without the matching DestinationRule subsets, a VirtualService that references subset v2 will not route correctly.
Hands-on example
Example subset definition:
apiVersion: networking.istio.io/v1
kind: DestinationRule
metadata:
name: reviews
spec:
host: reviews
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
trafficPolicy:
loadBalancer:
simple: LEAST_REQUESTCheck 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 a VirtualService, and what does it control?
- What is a Gateway resource, and how does it differ from a Kubernetes Ingress?
- How does traffic flow through an Envoy sidecar for inbound and outbound requests?
- What is the difference between an Istio ingress gateway and an egress gateway?
- What is the difference between ztunnel and a waypoint proxy in ambient mode?
- How do you do weighted traffic splitting for a canary release in Istio?
- What is the Istio ambient (sidecarless) mode, and how does it differ from sidecar mode?
- How does automatic sidecar injection work (namespace label, webhook)?