Traffic Management Use Cases
Control how traffic to your service is managed
Retry Policy
Configure automatic retries:
annotations:
gateway.tetrate.io/host: "api.example.com"
gateway.tetrate.io/retry-policy: |
attempts: 3
perTryTimeout: "10s"
retryOn: "5xx,reset,connect-failure,refused-stream"
retryBackOff:
baseInterval: 1s
maxInterval: 10s
Traffic Modes
Control gateway traffic direction:
annotations:
gateway.tetrate.io/host: "api.example.com"
gateway.tetrate.io/traffic-mode: "INGRESS" # Options: AUTO, INGRESS, EGRESS, TRANSIT
Global Multi-Cluster Exposure
Expose a service globally through edge clusters with weighted traffic distribution:
annotations:
gateway.tetrate.io/host: "global.example.com"
gateway.tetrate.io/expose: "global"
gateway.tetrate.io/edge-clusters: "us-west-1:70,eu-west-1:30" # 70% to US, 30% to EU
gateway.tetrate.io/protocol: "HTTPS"
gateway.tetrate.io/tls-secret: "global-tls"
This creates:
- Local Gateway: Routes to the service in the local cluster
- Edge Gateways: One per edge cluster, routing traffic back to the source cluster with specified weights
Weight formats:
"cluster1:70,cluster2:30"- Explicit weights for traffic distribution"cluster1,cluster2"- Weight 0 for all clusters enables locality-based routing"cluster1:70,cluster2"- Mixed format (cluster1 gets weight 70, cluster2 gets weight 0 for locality-based)
note
Weights do not need to sum to 100. A weight of 0 has special meaning: it enables locality-based routing where TSB automatically routes traffic based on proximity.
Path-Based Routing
Multiple services can share the same hostname with different paths:
# User Service
annotations:
gateway.tetrate.io/host: "api.example.com"
gateway.tetrate.io/path: "/v1/users"
# Product Service
annotations:
gateway.tetrate.io/host: "api.example.com"
gateway.tetrate.io/path: "/v1/products"
# Order Service
annotations:
gateway.tetrate.io/host: "api.example.com"
gateway.tetrate.io/path: "/v1/orders"
The system automatically handles routing with a longest-prefix-wins strategy and detects path conflicts between services.