-
Notifications
You must be signed in to change notification settings - Fork 0
/
load-balancer.yml
23 lines (20 loc) · 972 Bytes
/
load-balancer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Load balancing can be used to distribute requests to multiple service endpoints.
services:
myLoadBalancer:
host: lb.example.com
loadBalancer:
# Optionally enable session persistence (implemented with cookies).
# If this is set, cookies will be used to ensure a client will keep connecting to the same server.
# Cookies are overriden if the service fails health check.
persistent: true # Default: false.
strategy: random # Can be random, roundRobin, or failover. Default: roundRobin.
# random: choose a random service from the pool.
# roundRobin: choose service in a cyclic manner.
# failover: always choose the first service (still respects health checks).
serviceNames: ["server1", "server2"]
server1:
host: server1.example.com
redirect: "http://172.30.0.4:3000"
server2:
# No host specified, so server2 is only accessible through myLoadBalancer.
redirect: "http://172.24.0.2:8080"