Skip to content

Commit 08759ec

Browse files
wbpcodeirar2
authored andcommitted
Amend the endpoint picker protocol to support multiple fallback endpoints (kubernetes-sigs#761)
* Amend the endpoint picker protocol to support multiple fallback endpoints Signed-off-by: wangbaiping(wbpcode) <[email protected]> * address comments Signed-off-by: wangbaiping(wbpcode) <[email protected]> * add optionally Signed-off-by: wangbaiping(wbpcode) <[email protected]> * address comments Signed-off-by: wangbaiping(wbpcode) <[email protected]> * address comments Signed-off-by: wangbaiping(wbpcode) <[email protected]> --------- Signed-off-by: wangbaiping(wbpcode) <[email protected]>
1 parent 378f024 commit 08759ec

File tree

1 file changed

+15
-16
lines changed
  • docs/proposals/004-endpoint-picker-protocol

1 file changed

+15
-16
lines changed

docs/proposals/004-endpoint-picker-protocol/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ If the key `x-gateway-destination-endpoint-subset` is set, the EPP MUST only sel
2525
If the key `x-gateway-destination-endpoint-subset` is not set, then the EPP MUST select from the set defined by the `InferencePool` selector.
2626

2727
## Destination Endpoint
28-
For each HTTP request, the EPP MUST communicate to the proxy the picked model server endpoint via:
28+
For each HTTP request, the EPP MUST communicate to the proxy one or more selected model server endpoints via:
2929

30-
1. Setting the `x-gateway-destination-endpoint` HTTP header to the selected endpoint in <ip:port> format.
30+
1. Setting the `x-gateway-destination-endpoint` HTTP header to one or more selected endpoints.
3131

32-
2. Set an unstructured entry in the [dynamic_metadata](https://github.com/envoyproxy/go-control-plane/blob/c19bf63a811c90bf9e02f8e0dc1dcef94931ebb4/envoy/service/ext_proc/v3/external_processor.pb.go#L320) field of the ext-proc response. The metadata entry for the picked endpoint MUST be wrapped with an outer key (which represents the metadata namespace) with a default of `envoy.lb`.
32+
2. Set an unstructured entry in the [dynamic_metadata](https://github.com/envoyproxy/go-control-plane/blob/c19bf63a811c90bf9e02f8e0dc1dcef94931ebb4/envoy/service/ext_proc/v3/external_processor.pb.go#L320) field of the ext-proc response. The metadata entry for the picked endpoints MUST be wrapped with an outer key (which represents the metadata namespace) with a default of `envoy.lb`.
3333

3434
The primary endpoint MUST be set using the key `x-gateway-destination-endpoint` as follows:
3535
```go
@@ -39,26 +39,25 @@ dynamicMetadata: {
3939
}
4040
}
4141
```
42+
or:
43+
```go
44+
dynamicMetadata: {
45+
"envoy.lb": {
46+
"x-gateway-destination-endpoint": <ip:port>,<ip:port>,...
47+
}
48+
}
49+
```
50+
51+
The value of the header or metadata entry MUST contain at least one endpoint in `<ip:port>` format or multiple endpoints in `<ip:port>,<ip:port>,...` format. Multiple endpoints are separated by commas. The first valid endpoint in the list will be used. If retry is configured, the proxy will go sequentially down the list until one valid endpoint is found.
4252

4353
Constraints:
4454
- If the EPP did not communicate the server endpoint via these two methods, it MUST return an error as follows:
4555
- [ImmediateResponse](https://github.com/envoyproxy/envoy/blob/f2023ef77bdb4abaf9feef963c9a0c291f55568f/api/envoy/service/ext_proc/v3/external_processor.proto#L195) with 503 (Serivce Unavailable) HTTP status code if there are no ready endpoints.
4656
- [ImmediateResponse](https://github.com/envoyproxy/envoy/blob/f2023ef77bdb4abaf9feef963c9a0c291f55568f/api/envoy/service/ext_proc/v3/external_processor.proto#L195) with 429 (Too Many Requests) HTTP status code if the request should be dropped (e.g., a Sheddable request, and the servers under heavy load).
47-
- The EPP MUST not set two different values in the header and the inner response metadata value.
57+
- The EPP MUST not set two different values in the header and the inner response metadata value.
4858
- Setting different value leads to unpredictable behavior because proxies aren't guaranteed to support both paths, and so this protocol does not define what takes precedence.
4959

50-
### Destination endpoint fallback
51-
A single fallback endpoint CAN be set using the key `x-gateway-destination-endpoint-fallback` in the same metadata namespace as one used for `x-gateway-destination-endpoint` as follows:
52-
53-
```go
54-
dynamicMetadata: {
55-
"envoy.lb" {
56-
"x-gateway-destination-endpoint-fallback": <ip:port>
57-
}
58-
}
59-
```
60-
61-
### Why envoy.lb namespace as a default?
60+
### Why envoy.lb namespace as a default?
6261
The `envoy.lb` namespace is a predefined namespace. One common way to use the selected endpoint returned from the server, is [envoy subsets](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/subsets) where host metadata for subset load balancing must be placed under `envoy.lb`. Note that this is not related to the subsetting feature discussed above, this is an enovy implementation detail.
6362

6463
## Matching An InferenceModel

0 commit comments

Comments
 (0)