Merge pull request #1920 from dkulchinsky/dannyk/gatewayapi_backendRequest_timeout

adding BackendTimeout for Gateway API router
This commit is contained in:
Sanskar Jaiswal
2026-05-24 16:36:06 +05:30
committed by GitHub
9 changed files with 73 additions and 21 deletions
@@ -720,6 +720,38 @@ The above procedures can be extended with [custom metrics](../usage/metrics.md)
Besides the `hosts` and `gatewayRefs` fields, you can customize the generated HTTPRoute with various options
exposed under the `spec.service` field of the Canary.
### Timeouts
You can configure request timeouts on the generated HTTPRoute using the `spec.service.timeout` and
`spec.service.backendTimeout` fields of the Canary. Both values are
[Gateway API Duration](https://gateway-api.sigs.k8s.io/geps/gep-2257/) strings (e.g. `5s`, `500ms`).
- `timeout` maps to `HTTPRouteTimeouts.Request` and bounds the total request duration from when the gateway
receives the request to when the response is sent back to the client.
- `backendTimeout` maps to `HTTPRouteTimeouts.BackendRequest` and bounds the duration of an individual
request from the gateway to a backend. When set together with `timeout`, `backendTimeout` must be
less than or equal to `timeout`.
> **Note:** Timeouts require a Gateway API implementation that supports
> [`HTTPRouteTimeouts`](https://gateway-api.sigs.k8s.io/guides/user-guides/http-timeouts/).
> `backendTimeout` additionally requires support for the `BackendRequest` timeout field.
Example configuration:
```yaml
apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
name: podinfo
namespace: test
spec:
service:
# Total request timeout (gateway to client)
timeout: 5s
# Per-attempt backend request timeout (gateway to backend)
backendTimeout: 2s
```
### Header Manipulation
You can configure request and response header manipulation using the `spec.service.headers` field of the Canary.
+3
View File
@@ -230,6 +230,9 @@ spec:
attempts: 3
perTryTimeout: 1s
timeout: 5s
# backendTimeout is only supported by the Gateway API provider and
# maps to HTTPRouteTimeouts.BackendRequest.
backendTimeout: 2s
```
When using **Istio** as the mesh provider, you can also specify HTTP header operations,