@@ -3,22 +3,23 @@ A route is usually associated with one service through the `to:` token with
3
3
the service based on the xref:load-balancing[load balancing strategy].
4
4
5
5
It is possible to have as many as four services supporting the route. The
6
- portion of requests that are handled by each service is governed by the service
6
+ portion of requests that are handled by each service is governed by the service
7
7
`weight` .
8
8
9
9
The first service is entered using the `to:` token as before, and up to three
10
10
additional services can be entered using the `alternateBackend:` token. Each
11
11
service must be `kind: Service` which is the default.
12
12
13
- Each service can have a `weight` associated with it. The portion of requests
13
+ Each service has a `weight` associated with it. The portion of requests
14
14
handled by the service is `weight` / `sum_of_all_weights` . When a service has
15
15
more than one endpoint, the service's weight is distributed among the endpoints
16
16
with each endpoint getting at least 1. If the service `weight` is 0 each
17
- endpoint will get 0.
17
+ of the service's endpoints will get 0.
18
18
19
19
The `weight` must be in the range 0-256. The default is 1. When the `weight` is
20
20
0 no requests are passed to the service. If all services have `weight` 0,
21
- requests are returned with a 503 error.
21
+ requests are returned with a 503 error. When a sevice has no endpoints, the weight
22
+ is effectively 0.
22
23
23
24
When using `alternateBackends` also use the `roundrobin`
24
25
xref:load-balancing[load balancing strategy] to ensure requests are distributed
59
60
<2> The first service name is `service-name` which may have 0 or more pods
60
61
<3> The alternateBackend services may also have 0 or more pods
61
62
<4> The total `weight` is 40. `service-name` will get 20/40 or 1/2 of the requests,
62
- `service-name2` and `service-name3` will each get 1/4 of the requests.
63
+ `service-name2` and `service-name3` will each get 1/4 of the requests, assuming each
64
+ service has 1 or more endpoints.
0 commit comments