Lattice Hub Docs
Best practices

Pole Sidecar data plane

Run Pole Sidecar for local HTTP/gRPC routing while consuming control-plane active views.

Pole Sidecar fits multi-language services or teams that want governance in a local proxy. Forwarding is local; discovery and policy facts still come from Lattice Hub.

sidecar data plane

When to choose Sidecar

Choose SidecarChoose SDK
Multi-language / hard to change codeRust apps can embed directly
Need a unified local forward/intercept pointPrefer proxyless, one fewer hop
Pair with Controller injectionMature SDK governance path already exists

Quick start

cargo build
RUST_LOG=info cargo run
SIDECAR_CONFIG=./sidecar.toml RUST_LOG=debug cargo run

Requires Rust 1.74+. Match grpc_prefix before prefix. Sample LB is round-robin. Full sample TOML is in the Chinese practice page / pole-sidecar/sidecar.toml (inbound 8080, /api/backend_http, gRPC Greeter → backend_grpc).

Community demo

EntryWhat it does
Local samplepole-sidecar/sidecar.toml + RUST_LOG=info cargo run
Design docspole-sidecar/docs/design/
K8s injectpole-controller `sidecarInject.mode=dns
SDK contrastpole-client-rust/examples/{discover,config}.rs
cd pole-sidecar
cargo build
# start a local upstream on 127.0.0.1:9000, then:
RUST_LOG=info cargo run

How to verify

curl -sS -D - http://127.0.0.1:8080/api/hello
# expect forward to cluster backend_http endpoints per [[routes]] prefix=/api/

Also verify gRPC via grpc_prefix + content-type: application/grpc, and on Kubernetes check injected sidecar containers, readiness, and outbound targets. When pairing with governance, publish active route/rate-limit releases first, then observe proxy behavior—separate “rule not published” from “proxy not consuming”.

Expected effects

ScenarioEffect
HTTP prefix=/api/ matchForward to backend_http (round-robin)
gRPC grpc_prefix matchForward to backend_grpc
No route matchLocal reject / no forward (per Sidecar version)
dns injectDiscovery via DNS interception
mesh injectTraffic hijack; deeper intercept hooks
Local TOML onlyLocal routing may change; TOML is not cluster governance truth

Collaboration rules

  1. Control plane owns active service/config/governance views.
  2. Sidecar consumes those views; local TOML is not the long-term source of truth.
  3. Interceptor hooks should evaluate active configuration.
  4. Pair with Controller dns / mesh injection on Kubernetes.

Checklist

  • Cluster endpoints in Sidecar config are correct
  • Route prefixes do not collide; gRPC paths are complete
  • Control-plane active rules are published
  • Upstream reachability and timeouts are acceptable
  • Debug logging can be raised for triage
  • Sidecar is not described as a control-plane replacement

Deeper reading

On this page