Before configuring mirroring in Istio, it helps to understand common release strategies and how mirroring fits between them.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Release strategies: Canary vs Blue–Green
A canary release introduces a new version gradually. The majority of users continue to use the stable v1 application while a small percentage is routed to the new version (v2). This limits blast radius while exposing the new version to real traffic.

| Strategy | Rollout pattern | Risk exposure | Best for |
|---|---|---|---|
| Canary | Gradual traffic ramp (percent-based) | Low exposure early; increases as ramp proceeds | Safely validate behavior with a subset of users |
| Blue–Green | All-or-nothing cutover | Full exposure at switch; fast rollback possible | Quick, atomic switch when environments are ready |
What is Istio traffic mirroring?
Istio traffic mirroring sends a copy of live production requests to another version of your service (for example, a staging or test instance) while the original response still goes to production. Mirroring lets you exercise v2 with real requests and production payloads without affecting user-visible responses.
- Mirrored requests are copies — responses from the mirrored destination are ignored by Istio and never returned to the client.
- Mirroring is asynchronous and safe for exercising read-only behavior and performance testing.
- Avoid side effects (for example, writes to production databases) from mirrored requests unless you have safeguards (see the warning below).
Mirrored traffic still reaches the mirrored service. If that service performs writes (to databases, external APIs, or modifies shared state), those side-effects will occur unless explicitly isolated. Always ensure mirrored requests are safe or routed to an isolated environment to avoid corrupting production data.
Deployments and Service setup
To enable mirroring you need two versions of your application deployed — for examplev1 (production) and v2 (mirror/test). Both deployments can share the same Service selector (e.g., app: frontend) so that Istio can route to subsets defined by a DestinationRule.
Example Kubernetes Deployment and Service manifests:
- The Service
app-svcselects pods withapp: frontend. Subsets (v1, v2) are distinguished by theversionlabel and defined in a DestinationRule.
VirtualService and DestinationRule for mirroring
Mirroring is configured in an Istio VirtualService by adding amirror destination to the primary route. The mirrored subset(s) are declared in a matching DestinationRule.
Example VirtualService and DestinationRule that implement mirroring:
- The
routesection sends all user-facing requests to subsetv1. - The
mirrorsection sends a copy of each request to subsetv2. mirrorPercentcontrols the fraction of requests that are mirrored (0–100). Use lower values to sample mirrored traffic.
Mirrored requests are sent asynchronously to the mirror destination; responses from the mirrored service are ignored by Istio and not returned to the user. Mirroring is therefore safe for exercising behavior but should not be used for anything that affects observable user state (e.g., writing to production databases) unless you take appropriate safeguards.
Why use mirroring?

- Validate new service versions with real production traffic without impacting users.
- Discover issues earlier using live workloads and production payloads.
- Maintain zero user impact because mirrored responses are discarded.
- Confidently verify v2 behavior before a full cutover or canary ramp.
- Collect realistic performance metrics and debugging traces under production load.
Mirroring configuration options
Istio supports a few mirroring options you should know about:mirrordestination: specifies host/port/subset to receive mirrored requests.mirrorPercent: sample rate for mirrored traffic (0–100).PortSelector: explicitly choose a target port for mirrored traffic.HTTPMirrorPolicyfields available on the VirtualService HTTP route.

- Istio VirtualService reference: https://istio.io/latest/docs/reference/config/networking/virtual-service/
Quick checklist to enable mirroring
- Deploy production version (v1) and the mirrored/test version (v2).
- Ensure both deployments share the Service selector (for example
app: frontend). - Create a DestinationRule with
subsetsmatching theversionlabels. - Create or update the VirtualService: route primary traffic to
v1, setmirrortov2, and adjustmirrorPercent. - Monitor mirrored service logs, traces, and metrics to validate behavior.
- Gradually increase
mirrorPercentif you need more sampling before a full rollout.
Best practices
- Use mirroring for read-only validation, performance testing, and debugging.
- Isolate mirrored environments from production stateful systems (databases, billing systems) to prevent accidental writes.
- Start with a small
mirrorPercent(for example 1–5%) when traffic volume is high to limit load. - Combine mirroring with tracing and logging so you can correlate production and mirrored requests.
- Clean up or scale down mirrored deployments when validation is complete.
- Istio VirtualService docs: https://istio.io/latest/docs/reference/config/networking/virtual-service/