Skip to content

Commit 1047cb6

Browse files
committed
address comments
Signed-off-by: wangbaiping(wbpcode) <[email protected]>
1 parent c62d3b3 commit 1047cb6

File tree

1 file changed

+17
-18
lines changed
  • docs/proposals/004-endpoint-picker-protocol

1 file changed

+17
-18
lines changed

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ If the key `x-gateway-destination-endpoint-subset` is not set, then the EPP MUST
2727
## Destination Endpoint
2828
For each HTTP request, the EPP MUST communicate to the proxy the picked model server endpoint 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 the 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,28 +39,18 @@ dynamicMetadata: {
3939
}
4040
}
4141
```
42-
43-
Constraints:
44-
- If the EPP did not communicate the server endpoint via these two methods, it MUST return an error as follows:
45-
- [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.
46-
- [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.
48-
- 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.
49-
50-
### Destination endpoint fallback
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:
42+
or:
5543
```go
5644
dynamicMetadata: {
57-
"envoy.lb" {
58-
"x-gateway-destination-endpoint": "<ip:port>,<ip:port>,..."
45+
"envoy.lb": {
46+
"x-gateway-destination-endpoint": <ip:port>,<ip:port>,...
5947
}
6048
}
6149
```
6250

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:
51+
The value of the header or metadata entry MUST contains 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 value will be used. And if retrying is happening, the proxy will try the endpoints after the previously selected endpoint in order.
52+
53+
The EPP also can set additional endpoints by the key `x-gateway-destination-endpoint-fallback` in the same metadata namespace as one used for `x-gateway-destination-endpoint` as follows:
6454

6555
```go
6656
dynamicMetadata: {
@@ -70,6 +60,15 @@ dynamicMetadata: {
7060
}
7161
```
7262

63+
The endpoints specified in `x-gateway-destination-endpoint-fallback` MAY be tried after the endpoints specified in `x-gateway-destination-endpoint` if all the endpoints specified in `x-gateway-destination-endpoint` are unavailable.
64+
65+
Constraints:
66+
- If the EPP did not communicate the server endpoint via these two methods, it MUST return an error as follows:
67+
- [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.
68+
- [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).
69+
- The EPP MUST not set two different values in the header and the inner response metadata value.
70+
- 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.
71+
7372
### Why envoy.lb namespace as a default?
7473
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.
7574

0 commit comments

Comments
 (0)