implemented better routing system, config parsing from yaml.
This commit is contained in:
35
config.yaml
Normal file
35
config.yaml
Normal file
@@ -0,0 +1,35 @@
|
||||
backends:
|
||||
- id: "srv-1"
|
||||
ip: "127.0.0.1"
|
||||
port: 8081
|
||||
|
||||
- id: "srv-2"
|
||||
ip: "127.0.0.1"
|
||||
port: 8082
|
||||
|
||||
clusters:
|
||||
main-api:
|
||||
- "srv-1"
|
||||
- "srv-2"
|
||||
priority-api:
|
||||
- "srv-1"
|
||||
|
||||
rules:
|
||||
- clients:
|
||||
- "0.0.0.0/0:8080"
|
||||
targets:
|
||||
- "main-api"
|
||||
strategy:
|
||||
type: "RoundRobin"
|
||||
|
||||
- clients:
|
||||
- "0.0.0.0/0:6767"
|
||||
- "0.0.0.0/0:6969"
|
||||
targets: # no issues with duplicate servers or clusters
|
||||
- "priority-api"
|
||||
- "priority-api"
|
||||
- "priority-api"
|
||||
strategy:
|
||||
type: "Adaptive"
|
||||
coefficients: [ 1.5, 1.0, 0.5, 0.1 ]
|
||||
alpha: 0.75
|
||||
Reference in New Issue
Block a user