Make A/B deployment proportional to service weight
Distribute requests among the route's services based on service weight.
The portion of the total weight that each service has is distributed
evenly among the service's endpoints.
bug
@@ -47,9 +47,14 @@ type RouteList struct {
}
// RouteSpec describes the hostname or path the route exposes, any security information,
-// and one or more backends the route points to. Weights on each backend can define
-// the balance of traffic sent to each backend - if all weights are zero the route will
-// be considered to have no backends and return a standard 503 response.
+// and one to four backends (services) the route points to. Requests are distributed
+// among the backends depending on the weights assigned to each backend. When using
+// roundrobin scheduling the portion of requests that go to each backend is the backend
+// weight divided by the sum of all of the backend weights. When the backend has more than
+// one endpoint the requests that end up on the backend are roundrobin distributed among
+// the endpoints. Weights are between 0 and 256 with default 1. Weight 0 causes no requests
+// to the backend. If all weights are zero the route will be considered to have no backends
+// and return a standard 503 response.
//
// The `tls` field is optional and allows specific certificates or behavior for the
// route. Routers typically configure a default certificate on a wildcard domain to
@@ -66,13 +71,13 @@ type RouteSpec struct {
Path string `json:"path,omitempty" protobuf:"bytes,2,opt,name=path"`
// to is an object the route should use as the primary backend. Only the Service kind
- // is allowed, and it will be defaulted to Service. If the weight field is set to zero,
- // no traffic will be sent to this service.
+ // is allowed, and it will be defaulted to Service. If the weight field (0-256 default 1)
+ // is set to zero, no traffic will be sent to this backend.
To RouteTargetReference `json:"to" protobuf:"bytes,3,opt,name=to"`
- // alternateBackends is an extension of the 'to' field. If more than one service needs to be
- // pointed to, then use this field. Use the weight field in RouteTargetReference object
- // to specify relative preference. If the weight field is zero, the backend is ignored.
+ // alternateBackends allows up to 3 additional backends to be assigned to the route.
+ // Only the Service kind is allowed, and it will be defaulted to Service.
+ // Use the weight field in RouteTargetReference object to specify relative preference.
AlternateBackends []RouteTargetReference `json:"alternateBackends,omitempty" protobuf:"bytes,4,rep,name=alternateBackends"`
// If specified, the port to be used by the router. Most routers will use all
@@ -97,8 +102,8 @@ type RouteTargetReference struct {
// name of the service/target that is being referred to. e.g. name of the service
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
- // weight as an integer between 1 and 256 that specifies the target's relative weight
- // against other target reference objects
+ // weight as an integer between 0 and 256, default 1, that specifies the target's relative weight
+ // against other target reference objects. 0 suppresses requests to this backend.
Weight *int32 `json:"weight" protobuf:"varint,3,opt,name=weight"`
}
