Skip to content

Commit 77fbe07

Browse files
author
wangbaiping
committed
Amend the endpoint picker protocol to support multiple fallback endpoints
Signed-off-by: wangbaiping <[email protected]>
1 parent 927c700 commit 77fbe07

File tree

1 file changed

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

1 file changed

+15
-3
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,23 @@ Constraints:
4444
- If the EPP did not communicate the server endpoint via these two methods, it MUST return an error as follows:
4545
- [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.
4646
- [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.
47+
- The EPP MUST not set two different values in the header and the inner response metadata value.
4848
- 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.
4949

5050
### 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:
51+
52+
For each HTTP request, if destination endpoint fallback is necessary or possible, the EPP CAN set the `x-gateway-destination-endpoint` HTTP header or metadata entry with multiple addresses in `<ip:port>,<ip:port>,...` format. Multiple addresses are separated by commas. The first valid endpoint in the addresses list will be used as the primary endpoint. And if retrying is happening, the proxy will try the endpoints after the selected endpoint in order.
53+
54+
For example:
55+
```go
56+
dynamicMetadata: {
57+
"envoy.lb" {
58+
"x-gateway-destination-endpoint": "<ip:port>,<ip:port>,..."
59+
}
60+
}
61+
```
62+
63+
Single fallback endpoint also 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:
5264

5365
```go
5466
dynamicMetadata: {
@@ -58,7 +70,7 @@ dynamicMetadata: {
5870
}
5971
```
6072

61-
### Why envoy.lb namespace as a default?
73+
### Why envoy.lb namespace as a default?
6274
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.
6375

6476
## Matching An InferenceModel

0 commit comments

Comments
 (0)