Skip to content

Commit fb159a5

Browse files
committed
Amend the endpoint picker protocol to support fallbacks and subsetting
1 parent 406ffee commit fb159a5

File tree

1 file changed

+27
-5
lines changed
  • docs/proposals/004-endpoint-picker-protocol

1 file changed

+27
-5
lines changed

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

+27-5
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,49 @@ This doc defines the protocol between the EPP and the proxy (e.g, Envoy).
99
The EPP MUST implement the Envoy
1010
[external processing service](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/ext_proc/v3/external_processor) protocol.
1111

12+
## Proxy Request
13+
For each HTTP request, the proxy CAN communicate the subset of endpoints the EPP MUST pick from by setting an unstructured entry in the [filter metadata](https://github.com/envoyproxy/go-control-plane/blob/63a55395d7a39a8d43dcc7acc3d05e4cae7eb7a2/envoy/config/core/v3/base.pb.go#L819) field of the ext-proc request. The metadata entry for the subset list MUST be wrapped with an outer key (which represents the metadata namespace) with a default of `envoy.lb.subset_hint`.
14+
15+
```go
16+
filterMetadata: {
17+
"envoy.lb.subset_hint" {
18+
"x-gateway-destination-endpoint-subset-hint": [<ip:port>, <ip:port>, ...]
19+
}
20+
}
21+
```
22+
23+
## EPP Response
1224
For each HTTP request, the EPP MUST communicate to the proxy the picked model server endpoint via:
1325

1426
1. Setting the `x-gateway-destination-endpoint` HTTP header to the selected endpoint in <ip:port> format.
1527

16-
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`.
28+
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`.
1729

18-
The final metadata necessary would look like:
30+
The pirmary endpoint MUST be set using the key `x-gateway-destination-endpoint` as follows:
1931
```go
2032
dynamicMetadata: {
2133
"envoy.lb": {
22-
"x-gateway-destination-endpoint": <ip:port>"
34+
"x-gateway-destination-endpoint": <ip:port>
35+
}
36+
}
37+
```
38+
39+
Fallback endpoints MUST be set using the key `x-gateway-destination-endpoint-fallbacks` as a list as follows:
40+
```go
41+
dynamicMetadata: {
42+
"envoy.lb" {
43+
"x-gateway-destination-endpoint-fallbacks": [<ip:port>, <ip:port>, ...]
2344
}
2445
}
2546
```
2647

2748
Note:
2849
- If the EPP did not communicate the server endpoint via these two methods, it MUST return an error.
2950
- The EPP MUST not set two different values in the header and the inner response metadata value.
51+
- 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.
3052

31-
## Why envoy.lb namespace as a default?
53+
### Why envoy.lb namespace as a default?
3254
The `envoy.lb` namesapce is a predefined namespace used for subsetting. 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`.
3355

34-
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.
56+
3557

0 commit comments

Comments
 (0)