Skip to content

Commit d9dae43

Browse files
weltekialexellis
authored andcommitted
Add request timeouts to HTTPRoute examples in Gateway API post
Without an explicit timeouts.request value, Envoy Proxy defaults to 15s which is too short for most OpenFaaS functions. Set request timeout to 10m a good default. Explain the timeout should match gateway.writeTimeout in the OpenFaaS Helm chart. Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
1 parent 43a62ff commit d9dae43

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

_posts/2026-02-13-gateway-api-migration.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,17 @@ spec:
345345
- path:
346346
type: PathPrefix
347347
value: /
348+
timeouts:
349+
# Should match gateway.writeTimeout in the OpenFaaS Helm chart.
350+
# Envoy's default of 15s is too short for most functions.
351+
request: 10m
348352
backendRefs:
349353
- name: gateway
350354
port: 8080
351355
```
352356

357+
The `timeouts.request` field sets the maximum duration for the gateway to respond to an HTTP request. This value should be set to match the `gateway.writeTimeout` configured in the OpenFaaS Helm chart. If omitted, Envoy Proxy uses a default of 15 seconds which will cause functions with longer execution times to time out at the proxy level. See the [expanded timeouts guide](https://docs.openfaas.com/tutorials/expanded-timeouts/) for details on configuring all timeout values.
358+
353359
The `parentRefs` field defines which Gateway this route wants to be attached to, in this case the `openfaas-gateway` Gateway. The `hostnames` field filters requests by the Host header before rules are evaluated, ensuring only requests for `gw.example.com` are matched. The `backendRefs` field defines the backend service where matching requests are forwarded - in this case the OpenFaaS `gateway` service on port 8080.
354360

355361
### Attempt to reach a function
@@ -469,6 +475,10 @@ spec:
469475
- path:
470476
type: PathPrefix
471477
value: /
478+
timeouts:
479+
# Should match gateway.writeTimeout in the OpenFaaS Helm chart.
480+
# Envoy's default of 15s is too short for most functions.
481+
request: 10m
472482
backendRefs:
473483
- name: dashboard
474484
port: 8080

0 commit comments

Comments
 (0)