forked from praxis-proxy/praxis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcanary-routing.yaml
More file actions
51 lines (48 loc) · 1.49 KB
/
Copy pathcanary-routing.yaml
File metadata and controls
51 lines (48 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Canary Routing
#
# Sends ~10% of traffic to a canary backend while the stable
# backend handles the remaining ~90%. Weighted round-robin
# controls the split.
#
# ┌────────┐
# │ client │
# └───┬────┘
# │
# ┌───▼────┐
# │ proxy │ :8080
# └───┬────┘
# │ round_robin (weights 9:1)
# ├──────────────────────┐
# ┌───▼────┐ ┌───▼────┐
# │ stable │ :3001 │ canary │ :3002
# └────────┘ ~90% └────────┘ ~10%
#
# Usage:
# cargo run -p praxis-proxy -- \
# -c examples/configs/traffic-management/canary-routing.yaml
# for i in $(seq 1 10); do
# curl -s http://localhost:8080/
# echo
# done
# # ~9 responses from :3001, ~1 from :3002
listeners:
- name: default
address: "127.0.0.1:8080"
filter_chains:
- main
filter_chains:
- name: main
filters:
- filter: router
routes:
- path_prefix: "/"
cluster: backend
- filter: load_balancer
clusters:
- name: backend
load_balancer_strategy: round_robin
endpoints:
- address: "127.0.0.1:3001"
weight: 9 # stable — ~90% of requests
- address: "127.0.0.1:3002"
weight: 1 # canary — ~10% of requests