Request Routing
Overview
Request routing refers to the ability to redirect requests coming into a given service to an alternative destination, such as a sandbox fork of the service, based on metadata contained within that particular request. This allows each sandbox to selectively replace only some services in the overall set of microservices with forks, so you can test unmerged changes without having to launch a copy of every service in the chain.
The necessary sandbox metadata for routing is automatically added to all requests that reach your services through a endpoint. If you additionally set up context propagation within each service, request routing can take effect not only for that initial request, but also for any subsequent service-to-service requests in the chain.
Routing Requests
The requests can then be examined for sandbox metadata and either sent to a fork of the service or passed through to the baseline service.
Signadot supports three routing approaches, distinguished by where the routing decision is made:
Destination-side Routing (DevMesh)
With DevMesh routing, the routing decision happens at the destination service's pod. A DevMesh sidecar container on the destination service (e.g., Service B) examines incoming requests and routes them to either the sandbox fork or the baseline service based on metadata in the request.
The DevMesh sidecar is injected into baseline workloads and acts as a L7 HTTP or gRPC proxy that provides lightweight request routing functionality. The sidecar examines requests for sandbox metadata and decides whether to route them to a fork or pass them through to the main container.
Service A Pod Service B Pod (with DevMesh Sidecar)
│ │
Main Container ──────────────────>│
│ │ DevMesh Sidecar
│ │ (Routing decision here) ⚡
│ ↓
│ ┌────────┴─────────┐
│ │ │
│ Sandbox Fork Baseline
│ of Service B Service B
│ (header match) (no header match)
Source-side Routing (Service Mesh)
With service mesh routing (e.g., Istio), the routing decision happens at the source service's pod. A service mesh sidecar on the source service (e.g., Service A) determines where to send the request based on the sandbox metadata and routes it directly to the destination's sandbox fork or baseline.
Service A Pod (with Istio Sidecar) Destination Pods
│ ┌─────────────┐
Main Container │ Sandbox │
│ │ Fork B" │
↓ │ (match) │
Istio Sidecar ─────────────────────────▶│ │
(Routing decision here) ⚡ └─────────────┘
│
└─────────────────────────────┐ ┌──────── ─────┐
│ │ Baseline │
└───▶│ Service B │
│ (default) │
└─────────────┘
Waypoint Routing (Istio Ambient Mode)
In Istio ambient mode, pods have no sidecar. The node's ztunnel proxy carries the request without reading headers, and the routing decision happens at a waypoint proxy attached to the destination Service (e.g., Service B). If Service B has no waypoint, requests from ambient workloads always reach the baseline.
Service A Pod (ambient)
│
Main Container
│
↓
Node ztunnel (L4 only, no header checks)
│
↓
Service B Waypoint ───────────────┐ ┌─────────────┐
(Routing decision here) ⚡ ├───▶│ Sandbox │
│ │ Fork B │
│ │ (match) │
│ └─────────────┘
│ ┌─────────────┐
└───▶│ Baseline │
│ Service B │
│ (default) │
└─────────────┘
When to Use Each Approach
Which approach applies depends mainly on whether your cluster already has a service mesh, and for Istio, whether your workloads run with sidecars or in ambient mode:
-
DevMesh should be used when you don't have a service mesh or are using Linkerd.
-
Service Mesh routing (Istio) should be used when you already have Istio installed.
-
Waypoint routing is how Istio routing works for workloads in Istio ambient mode. Every forked Service that ambient workloads call needs a waypoint. See Istio Ambient Mode.
-
Gateway API (alpha) can be used when you have Gateway API resources (HTTPRoute, GRPCRoute). See limitations.
These mechanisms are described in more detail in the following sections.
Excluding a Service from Routing
By default, when a workload is forked into a sandbox, Signadot derives routes for the baseline Kubernetes Services that select that workload, so requests carrying the sandbox's routing key reach the fork. To keep a specific Service out of this — so that no derived routes are created for it — annotate the Service:
apiVersion: v1
kind: Service
metadata:
annotations:
routing.signadot.com/ignore: "true"
This applies regardless of the routing mechanism (DevMesh, Istio, or Gateway API): the annotated Service is skipped when Signadot discovers the baseline Services behind a forked workload. The workload itself still runs and remains reachable in-cluster as usual; only the creation of sandbox routes for that Service is suppressed.
The value is a boolean string:
"true"— the Service is excluded from routing."false"— the Service is explicitly included (useful to override a templated or inherited value).- Absent — the Service is included (the default).
Set the value explicitly to "true" or "false"; on a Service, a
present-but-unparsable value is treated as "true" (excluded).
The same routing.signadot.com/ignore annotation can be placed on an individual
Gateway API HTTPRoute/GRPCRoute to exclude that route rather than a whole
Service — see Excluding
Routes. For Istio,
the istio.signadot.com/ignore annotation on a VirtualService serves the same
purpose — see Istio.
If you only need to deploy a workload into a sandbox without any routing at all,
a resource plugin such as k8s-apply is an alternative to forking a Service.
Routing Mechanisms
Signadot supports setting up request routing in the following ways:
📄️ Header-Based Routing
Using context propagation for isolating request flows
📄️ Query Parameter-Based Routing
Route requests to sandboxes using URL query parameters
📄️ DevMesh
Routing requests using the Signadot DevMesh
📄️ Istio
Routing requests using Istio
📄️ Istio Route Customization (Alpha)
Advanced customization of Istio VirtualService routes using annotations
📄️ Istio Ambient Mode
Route sandbox requests in Istio ambient mode with waypoints, including clusters that mix ambient and sidecar namespaces
📄️ Gateway API (Alpha)
Routing requests using Kubernetes Gateway API
📄️ Gateway API Route Customization (Alpha)
Advanced customization of Gateway API HTTPRoute and GRPCRoute derived routes using annotations
📄️ Linkerd
Routing requests using Linkerd