Skip to content

Commit 0d2add8

Browse files
committed
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 1470350 https://bugzilla.redhat.com/show_bug.cgi?id=1470350
1 parent 198b66f commit 0d2add8

File tree

13 files changed

+602
-57
lines changed

13 files changed

+602
-57
lines changed

api/protobuf-spec/github_com_openshift_origin_pkg_route_apis_route_v1.proto

Lines changed: 15 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/oapi-v1.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31412,7 +31412,7 @@
3141231412
},
3141331413
"v1.RouteSpec": {
3141431414
"id": "v1.RouteSpec",
31415-
"description": "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.\n\nThe `tls` field is optional and allows specific certificates or behavior for the route. Routers typically configure a default certificate on a wildcard domain to terminate routes without explicit certificates, but custom hostnames usually must choose passthrough (send traffic directly to the backend via the TLS Server-Name- Indication field) or provide a certificate.",
31415+
"description": "RouteSpec describes the hostname or path the route exposes, any security information, 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.\n\nThe `tls` field is optional and allows specific certificates or behavior for the route. Routers typically configure a default certificate on a wildcard domain to terminate routes without explicit certificates, but custom hostnames usually must choose passthrough (send traffic directly to the backend via the TLS Server-Name- Indication field) or provide a certificate.",
3141631416
"required": [
3141731417
"host",
3141831418
"to"
@@ -31428,14 +31428,14 @@
3142831428
},
3142931429
"to": {
3143031430
"$ref": "v1.RouteTargetReference",
31431-
"description": "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."
31431+
"description": "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 (0-256 default 1) is set to zero, no traffic will be sent to this backend."
3143231432
},
3143331433
"alternateBackends": {
3143431434
"type": "array",
3143531435
"items": {
3143631436
"$ref": "v1.RouteTargetReference"
3143731437
},
31438-
"description": "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."
31438+
"description": "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."
3143931439
},
3144031440
"port": {
3144131441
"$ref": "v1.RoutePort",
@@ -31471,7 +31471,7 @@
3147131471
"weight": {
3147231472
"type": "integer",
3147331473
"format": "int32",
31474-
"description": "weight as an integer between 1 and 256 that specifies the target's relative weight against other target reference objects"
31474+
"description": "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."
3147531475
}
3147631476
}
3147731477
},

api/swagger-spec/openshift-openapi-spec.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99073,14 +99073,14 @@
9907399073
}
9907499074
},
9907599075
"com.github.openshift.origin.pkg.route.apis.route.v1.RouteSpec": {
99076-
"description": "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.\n\nThe `tls` field is optional and allows specific certificates or behavior for the route. Routers typically configure a default certificate on a wildcard domain to terminate routes without explicit certificates, but custom hostnames usually must choose passthrough (send traffic directly to the backend via the TLS Server-Name- Indication field) or provide a certificate.",
99076+
"description": "RouteSpec describes the hostname or path the route exposes, any security information, 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.\n\nThe `tls` field is optional and allows specific certificates or behavior for the route. Routers typically configure a default certificate on a wildcard domain to terminate routes without explicit certificates, but custom hostnames usually must choose passthrough (send traffic directly to the backend via the TLS Server-Name- Indication field) or provide a certificate.",
9907799077
"required": [
9907899078
"host",
9907999079
"to"
9908099080
],
9908199081
"properties": {
9908299082
"alternateBackends": {
99083-
"description": "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.",
99083+
"description": "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.",
9908499084
"type": "array",
9908599085
"items": {
9908699086
"$ref": "#/definitions/com.github.openshift.origin.pkg.route.apis.route.v1.RouteTargetReference"
@@ -99103,7 +99103,7 @@
9910399103
"$ref": "#/definitions/com.github.openshift.origin.pkg.route.apis.route.v1.TLSConfig"
9910499104
},
9910599105
"to": {
99106-
"description": "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.",
99106+
"description": "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 (0-256 default 1) is set to zero, no traffic will be sent to this backend.",
9910799107
"$ref": "#/definitions/com.github.openshift.origin.pkg.route.apis.route.v1.RouteTargetReference"
9910899108
},
9910999109
"wildcardPolicy": {
@@ -99144,7 +99144,7 @@
9914499144
"type": "string"
9914599145
},
9914699146
"weight": {
99147-
"description": "weight as an integer between 1 and 256 that specifies the target's relative weight against other target reference objects",
99147+
"description": "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.",
9914899148
"type": "integer",
9914999149
"format": "int32"
9915099150
}

0 commit comments

Comments
 (0)