Skip to content

[enterprise-3.7] Router - changes to A/B weights discussion #7568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions architecture/topics/alternate_backends_weights.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ A route is usually associated with one service through the `to:` token with
the service based on the xref:load-balancing[load balancing strategy].

It is possible to have as many as four services supporting the route. The
portion of requests that are handled by each service is governed by the service
portion of requests that are handled by each service is governed by the service
`weight`.

The first service is entered using the `to:` token as before, and up to three
additional services can be entered using the `alternateBackend:` token. Each
service must be `kind: Service` which is the default.

Each service can have a `weight` associated with it. The portion of requests
Each service has a `weight` associated with it. The portion of requests
handled by the service is `weight` / `sum_of_all_weights`. When a service has
more than one endpoint, the service's weight is distributed among the endpoints
with each endpoint getting at least 1. If the service `weight` is 0 each
endpoint will get 0.
of the service's endpoints will get 0.

The `weight` must be in the range 0-256. The default is 1. When the `weight` is
0 no requests are passed to the service. If all services have `weight` 0,
requests are returned with a 503 error.
requests are returned with a 503 error. When a sevice has no endpoints, the weight
is effectively 0.

When using `alternateBackends` also use the `roundrobin`
xref:load-balancing[load balancing strategy] to ensure requests are distributed
Expand Down Expand Up @@ -59,4 +60,5 @@ spec:
<2> The first service name is `service-name` which may have 0 or more pods
<3> The alternateBackend services may also have 0 or more pods
<4> The total `weight` is 40. `service-name` will get 20/40 or 1/2 of the requests,
`service-name2` and `service-name3` will each get 1/4 of the requests.
`service-name2` and `service-name3` will each get 1/4 of the requests, assuming each
service has 1 or more endpoints.