Skip to content

Commit 067a276

Browse files
authored
docs(grpc): add note on using BackendTrafficPolicy for GPRC timeouts (#5822)
docs(grpc): add note on using for GPRC timeouts Signed-off-by: antvirf <[email protected]>
1 parent c699d88 commit 067a276

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

site/content/en/latest/tasks/traffic/grpc-routing.md

+22
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ curl --http2-prior-knowledge -s ${GATEWAY_HOST}:80/yages.Echo/Ping -H 'Host: grp
8484
```
8585

8686
## GRPCRoute Match
87+
8788
The `matches` field can be used to restrict the route to a specific set of requests based on GRPC's service and/or method names.
8889
It supports two match types: `Exact` and `RegularExpression`.
8990

@@ -262,6 +263,27 @@ Test GRPC routing to the `yages` backend using the [grpcurl][] command.
262263
grpcurl -plaintext -authority=grpc-example.com ${GATEWAY_HOST}:80 yages.Echo/Ping
263264
```
264265

266+
## Configuring or disabling timeouts with `BackendTrafficPolicy`
267+
268+
Streaming GRPC connections will often have lifespans longer than the default Envoy proxy timeout of 15 seconds. With Envoy Gateway, this timeout value can be configured using a [BackendTrafficPolicy][] resource:
269+
270+
```yaml
271+
apiVersion: gateway.envoyproxy.io/v1alpha1
272+
kind: BackendTrafficPolicy
273+
metadata:
274+
name: configure-timeout-policy
275+
spec:
276+
targetRefs:
277+
- group: gateway.networking.k8s.io
278+
kind: GRPCRoute
279+
name: name-of-my-grpc-route
280+
timeout:
281+
http:
282+
# Set to '0s' to disable timeouts
283+
requestTimeout: 0s
284+
```
285+
286+
[BackendTrafficPolicy]: ../../api/extension_types#backendtrafficpolicy
265287
[GRPCRoute]: https://gateway-api.sigs.k8s.io/api-types/grpcroute/
266288
[Gateway API documentation]: https://gateway-api.sigs.k8s.io/
267289
[GatewayClass]: https://gateway-api.sigs.k8s.io/api-types/gatewayclass/

site/content/en/v1.2/tasks/traffic/grpc-routing.md

+22
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ curl --http2-prior-knowledge -s ${GATEWAY_HOST}:80/yages.Echo/Ping -H 'Host: grp
8484
```
8585

8686
## GRPCRoute Match
87+
8788
The `matches` field can be used to restrict the route to a specific set of requests based on GRPC's service and/or method names.
8889
It supports two match types: `Exact` and `RegularExpression`.
8990

@@ -262,6 +263,27 @@ Test GRPC routing to the `yages` backend using the [grpcurl][] command.
262263
grpcurl -plaintext -authority=grpc-example.com ${GATEWAY_HOST}:80 yages.Echo/Ping
263264
```
264265

266+
## Configuring or disabling timeouts with `BackendTrafficPolicy`
267+
268+
Streaming GRPC connections will often have lifespans longer than the default Envoy proxy timeout of 15 seconds. With Envoy Gateway, this timeout value can be configured using a [BackendTrafficPolicy][] resource:
269+
270+
```yaml
271+
apiVersion: gateway.envoyproxy.io/v1alpha1
272+
kind: BackendTrafficPolicy
273+
metadata:
274+
name: configure-timeout-policy
275+
spec:
276+
targetRefs:
277+
- group: gateway.networking.k8s.io
278+
kind: GRPCRoute
279+
name: name-of-my-grpc-route
280+
timeout:
281+
http:
282+
# Set to '0s' to disable timeouts
283+
requestTimeout: 0s
284+
```
285+
286+
[BackendTrafficPolicy]: ../../api/extension_types#backendtrafficpolicy
265287
[GRPCRoute]: https://gateway-api.sigs.k8s.io/api-types/grpcroute/
266288
[Gateway API documentation]: https://gateway-api.sigs.k8s.io/
267289
[GatewayClass]: https://gateway-api.sigs.k8s.io/api-types/gatewayclass/

site/content/en/v1.3/tasks/traffic/grpc-routing.md

+22
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ curl --http2-prior-knowledge -s ${GATEWAY_HOST}:80/yages.Echo/Ping -H 'Host: grp
8484
```
8585

8686
## GRPCRoute Match
87+
8788
The `matches` field can be used to restrict the route to a specific set of requests based on GRPC's service and/or method names.
8889
It supports two match types: `Exact` and `RegularExpression`.
8990

@@ -262,6 +263,27 @@ Test GRPC routing to the `yages` backend using the [grpcurl][] command.
262263
grpcurl -plaintext -authority=grpc-example.com ${GATEWAY_HOST}:80 yages.Echo/Ping
263264
```
264265

266+
## Configuring or disabling timeouts with `BackendTrafficPolicy`
267+
268+
Streaming GRPC connections will often have lifespans longer than the default Envoy proxy timeout of 15 seconds. With Envoy Gateway, this timeout value can be configured using a [BackendTrafficPolicy][] resource:
269+
270+
```yaml
271+
apiVersion: gateway.envoyproxy.io/v1alpha1
272+
kind: BackendTrafficPolicy
273+
metadata:
274+
name: configure-timeout-policy
275+
spec:
276+
targetRefs:
277+
- group: gateway.networking.k8s.io
278+
kind: GRPCRoute
279+
name: name-of-my-grpc-route
280+
timeout:
281+
http:
282+
# Set to '0s' to disable timeouts
283+
requestTimeout: 0s
284+
```
285+
286+
[BackendTrafficPolicy]: ../../api/extension_types#backendtrafficpolicy
265287
[GRPCRoute]: https://gateway-api.sigs.k8s.io/api-types/grpcroute/
266288
[Gateway API documentation]: https://gateway-api.sigs.k8s.io/
267289
[GatewayClass]: https://gateway-api.sigs.k8s.io/api-types/gatewayclass/

0 commit comments

Comments
 (0)