Ambient Mode uses the
ztunnel DaemonSet for L4 routing and an optional waypoint (Envoy) proxy for L7 behaviors. Some Istio features (for example, split traffic using VirtualService subsets or mirroring) require different Kubernetes-native APIs in Ambient Mode.Table: Sidecar vs Ambient — API/Behavior mapping
References:
Verify Ambient components
Assuming Istio Ambient Mode has been installed, confirm the core control-plane components are running in theistio-system namespace:
istio.io/dataplane-mode=ambientistio.io/use-waypoint=waypoint(for namespaces that need L7 capabilities)
Deploy the HelloWorld app (example)
This demo uses a simple Hello World app with two versions (v1 and v2). The repository containshelloworld.yaml which creates two deployments and a catch-all service.
Deploy into the hello namespace:
Attempt: split traffic using DestinationRule + VirtualService (sidecar-style)
In sidecar-based deployments, you typically split traffic using aDestinationRule with subsets and a VirtualService with weighted routes.
Example sidecar-style VirtualService:
DestinationRule:
ztunnel handles L4 routing and does not support VirtualService subset routing in the same way sidecars do. Results may appear random or not follow the configured weights.
Correct approach for split traffic in Ambient Mode: HTTPRoute + waypoint
To implement weighted HTTP split routing in Ambient Mode, use the Kubernetes Gateway APIHTTPRoute (gateway.networking.k8s.io/v1) and configure a waypoint proxy that performs L7 processing.
High-level steps:
- Create a waypoint proxy for the namespace (generates the waypoint Envoy).
- Remove the sidecar-style
VirtualService/DestinationRule. - Create per-version Kubernetes Services and an
HTTPRoutethat references those services with weights. - Test traffic distribution via the waypoint proxy.
- Create the waypoint for the
hellonamespace:
- Remove the sidecar-style rules that do not provide the expected split semantics in Ambient Mode:
- Create an
HTTPRoutethat attaches to the catch-allhelloworldService (port 5000) and splits traffic usingbackendRefs. Save ashello-httproute-split-traffic.yaml:
backendRefs must reference Kubernetes Services. Create two per-version services (one per deployment) in addition to the catch-all helloworld service.
Example per-version Service YAML (can be added to helloworld.yaml or a separate file):
helloworld manifests):
- Test the split behavior from a test pod:
Notes: features not fully supported (yet)
- Mirroring is not supported in Ambient Mode (as of this writing).
- Some features like certain timeouts and retries may not behave identically under Ambient Mode L7 processing. Always check release notes and the Istio roadmap for current support.
HTTPRoute+ waypoint is the recommended Kubernetes-native pattern for L7 behavior (weights) in Ambient Mode.
Ambient Mode behavior is evolving. If a feature behaves differently than sidecar mode, consult the Istio Ambient Mode documentation and Istio release notes for current status and supported APIs.
Example: httpbin with delay and abort fault injection (waypoint + VirtualService)
For L7 fault injection (delay/abort) you can often useVirtualService APIs when a waypoint proxy is handling L7. This example deploys httpbin into a waypoint-enabled namespace and applies VirtualService fault rules.
- Label the namespace and create a waypoint for
httpbin:
- Deploy
httpbin:
- Test the basic GET route from the test pod:
- Inject a delay (VirtualService fault injection). Save as
httpbin-vs-delay.yaml:
- Inject an abort (500). Save as
httpbin-vs-abort.yaml:
HEAD request to inspect the HTTP status:
httpStatus (for example, to 404) and reapply to modify abort behavior.
Summary / Best practices
- Ambient Mode uses
ztunnelfor L4 routing and a waypoint Envoy proxy for L7 features. - Sidecar-mode primitives (VirtualService subsets + DestinationRules) do not reliably provide the same split semantics in Ambient Mode.
- For HTTP request splitting in Ambient Mode, prefer the Kubernetes Gateway API
HTTPRouteattached to the catch-all service, withbackendRefservices (one service per deployment/version). - For L7 fault injection (delay/abort), the waypoint proxy combined with
VirtualServiceoften works — but confirm support per Istio release. - Ambient Mode is evolving; always consult the Istio docs and release notes for current API support and recommended patterns.