diff --git a/api/v1alpha1/timeout_types.go b/api/v1alpha1/timeout_types.go index 5ac0cf7fba9..df33290987e 100644 --- a/api/v1alpha1/timeout_types.go +++ b/api/v1alpha1/timeout_types.go @@ -45,6 +45,14 @@ type HTTPTimeout struct { // // +optional RequestTimeout *gwapiv1.Duration `json:"requestTimeout,omitempty" yaml:"requestTimeout,omitempty"` + + // MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + // from when the request is sent until the response stream is fully consumed and does not apply to + // non-streaming requests. + // When set to "0s", no max duration is applied and streams can run indefinitely. + // + // +optional + MaxStreamDuration *gwapiv1.Duration `json:"maxStreamDuration,omitempty"` } type ClientTimeout struct { diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 563c78fa1eb..abef1052ac9 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -3697,6 +3697,11 @@ func (in *HTTPTimeout) DeepCopyInto(out *HTTPTimeout) { *out = new(v1.Duration) **out = **in } + if in.MaxStreamDuration != nil { + in, out := &in.MaxStreamDuration, &out.MaxStreamDuration + *out = new(v1.Duration) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPTimeout. diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index 12bdafa7c1d..ecc9059d805 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -2251,6 +2251,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml index f6232bd4dfa..b5880e0e095 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -1076,6 +1076,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml index 5db119ac0d8..cc3b0f29527 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml @@ -12072,6 +12072,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -13271,6 +13279,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -14551,6 +14567,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -15744,6 +15768,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the diff --git a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml index d67461b6bf3..d0b86bda985 100644 --- a/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml +++ b/charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_securitypolicies.yaml @@ -1598,6 +1598,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -2687,6 +2695,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -3992,6 +4008,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -5345,6 +5369,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml index f21a093df2c..125c4ddf8c3 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backendtrafficpolicies.yaml @@ -2250,6 +2250,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml index 6bf1b5b3b23..1447f8ca6bb 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyextensionpolicies.yaml @@ -1075,6 +1075,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml index 792bd0eccb8..1dac4cd8b67 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml @@ -12071,6 +12071,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -13270,6 +13278,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -14550,6 +14566,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -15743,6 +15767,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml index b6623997470..9a34fadfcc2 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_securitypolicies.yaml @@ -1597,6 +1597,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -2686,6 +2694,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -3991,6 +4007,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -5344,6 +5368,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. diff --git a/internal/gatewayapi/clustersettings.go b/internal/gatewayapi/clustersettings.go index ada6f4e2823..3acf56882d3 100644 --- a/internal/gatewayapi/clustersettings.go +++ b/internal/gatewayapi/clustersettings.go @@ -141,10 +141,21 @@ func buildClusterSettingsTimeout(policy *egv1a1.ClusterSettings) (*ir.Timeout, e } } + var msd *metav1.Duration + if pto.HTTP.MaxStreamDuration != nil { + d, err := time.ParseDuration(string(*pto.HTTP.MaxStreamDuration)) + if err != nil { + errs = errors.Join(errs, fmt.Errorf("invalid MaxStreamDuration value %s", *pto.HTTP.MaxStreamDuration)) + } else { + msd = ptr.To(metav1.Duration{Duration: d}) + } + } + to.HTTP = &ir.HTTPTimeout{ ConnectionIdleTimeout: cit, MaxConnectionDuration: mcd, RequestTimeout: rt, + MaxStreamDuration: msd, } } return to, errs diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.in.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.in.yaml index 30a9a3133ab..6667cbb1e8d 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.in.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.in.yaml @@ -82,6 +82,7 @@ backendTrafficPolicies: connectionIdleTimeout: 16s maxConnectionDuration: 17s requestTimeout: 18s + maxStreamDuration: 30s - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: BackendTrafficPolicy metadata: @@ -99,3 +100,4 @@ backendTrafficPolicies: connectionIdleTimeout: 21s maxConnectionDuration: 22s requestTimeout: 23s + maxStreamDuration: 0s diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml index 44c54696ce8..18b124139f1 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml @@ -13,6 +13,7 @@ backendTrafficPolicies: http: connectionIdleTimeout: 21s maxConnectionDuration: 22s + maxStreamDuration: 0s requestTimeout: 23s tcp: connectTimeout: 20s @@ -45,6 +46,7 @@ backendTrafficPolicies: http: connectionIdleTimeout: 16s maxConnectionDuration: 17s + maxStreamDuration: 30s requestTimeout: 18s tcp: connectTimeout: 15s @@ -324,6 +326,7 @@ xdsIR: http: connectionIdleTimeout: 16s maxConnectionDuration: 17s + maxStreamDuration: 30s requestTimeout: 18s tcp: connectTimeout: 15s @@ -407,6 +410,7 @@ xdsIR: http: connectionIdleTimeout: 21s maxConnectionDuration: 22s + maxStreamDuration: 0s requestTimeout: 23s tcp: connectTimeout: 20s diff --git a/internal/ir/xds.go b/internal/ir/xds.go index a68b3610e2c..6fd5106a3e2 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -2926,6 +2926,9 @@ type HTTPTimeout struct { // The maximum duration of an HTTP connection. MaxConnectionDuration *metav1.Duration `json:"maxConnectionDuration,omitempty" yaml:"maxConnectionDuration,omitempty"` + + // The maximum duration of an HTTP stream. + MaxStreamDuration *metav1.Duration `json:"maxStreamDuration,omitempty" yaml:"maxStreamDuration,omitempty"` } // Retry define the retry policy configuration. diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 378a01b8e2a..217ca07fcaf 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -1968,6 +1968,11 @@ func (in *HTTPTimeout) DeepCopyInto(out *HTTPTimeout) { *out = new(v1.Duration) **out = **in } + if in.MaxStreamDuration != nil { + in, out := &in.MaxStreamDuration, &out.MaxStreamDuration + *out = new(v1.Duration) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPTimeout. diff --git a/internal/xds/translator/route.go b/internal/xds/translator/route.go index c23d59c960a..c255e5f01f0 100644 --- a/internal/xds/translator/route.go +++ b/internal/xds/translator/route.go @@ -107,6 +107,18 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute, httpListener *ir.HTTPListener) (*rou if rt != nil { router.GetRoute().Timeout = durationpb.New(rt.Duration) } + + // Check if MaxStreamDuration is configured + if httpRoute.Traffic != nil && + httpRoute.Traffic.Timeout != nil && + httpRoute.Traffic.Timeout.HTTP != nil { + if httpRoute.Traffic.Timeout.HTTP.MaxStreamDuration != nil { + maxStreamDuration := &routev3.RouteAction_MaxStreamDuration{ + MaxStreamDuration: durationpb.New(httpRoute.Traffic.Timeout.HTTP.MaxStreamDuration.Duration), + } + router.GetRoute().MaxStreamDuration = maxStreamDuration + } + } } // Retries diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml index b95b72c5a01..9164b6b0822 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml @@ -14,6 +14,7 @@ http: timeout: http: requestTimeout: 5s + maxStreamDuration: 10s headerMatches: - name: user stringMatch: @@ -31,6 +32,7 @@ http: timeout: http: requestTimeout: 4000s + maxStreamDuration: 0s destination: name: "second-route-dest" settings: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml index 1c335ad621e..4585dc7b0bd 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml @@ -15,6 +15,8 @@ route: cluster: first-route-dest idleTimeout: 3600s + maxStreamDuration: + maxStreamDuration: 10s timeout: 5s upgradeConfigs: - upgradeType: websocket @@ -24,6 +26,8 @@ route: cluster: second-route-dest idleTimeout: 4000s + maxStreamDuration: + maxStreamDuration: 0s timeout: 4000s upgradeConfigs: - upgradeType: websocket diff --git a/release-notes/current.yaml b/release-notes/current.yaml index f5b444e2126..f6a6ee2b72f 100644 --- a/release-notes/current.yaml +++ b/release-notes/current.yaml @@ -25,10 +25,10 @@ new features: | Added support for per-backend client TLS settings in Backend resources. This allows configuring the client certificate as well as TLS protocol parameters such as ciphers, TLS versions, and ALPN protocols on a per-backend basis. Added support for returning 503 responses when no valid backend endpoints exist. Added support for CSRFTokenTTL in OIDC authn to configure the lifetime of the CSRF token used during the OAuth2 authorization code flow. + Added support for http2 stream timeout Added support for Envoy PreconnectPolicy in BackendTrafficPolicy. Added support for binaryData in ConfigMap referenced by HTTPRouteFilter for direct response. - bug fixes: | Fixed %ROUTE_KIND% operator to be lower-cased when used by clusterStatName in EnvoyProxy API. Fixed maxAcceptPerSocketEvent being ignored in ClientTrafficPolicy. diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 85803e5abe0..da94c842abf 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -2488,6 +2488,7 @@ _Appears in:_ | `connectionIdleTimeout` | _[Duration](https://gateway-api.sigs.k8s.io/reference/spec/#duration)_ | false | | The idle timeout for an HTTP connection. Idle time is defined as a period in which there are no active requests in the connection.
Default: 1 hour. | | `maxConnectionDuration` | _[Duration](https://gateway-api.sigs.k8s.io/reference/spec/#duration)_ | false | | The maximum duration of an HTTP connection.
Default: unlimited. | | `requestTimeout` | _[Duration](https://gateway-api.sigs.k8s.io/reference/spec/#duration)_ | false | | RequestTimeout is the time until which entire response is received from the upstream. | +| `maxStreamDuration` | _[Duration](https://gateway-api.sigs.k8s.io/reference/spec/#duration)_ | false | | MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time
from when the request is sent until the response stream is fully consumed and does not apply to
non-streaming requests.
When set to "0s", no max duration is applied and streams can run indefinitely. | #### HTTPURLRewriteFilter diff --git a/test/helm/gateway-crds-helm/all.out.yaml b/test/helm/gateway-crds-helm/all.out.yaml index eccbac99b5c..8163bb666f2 100644 --- a/test/helm/gateway-crds-helm/all.out.yaml +++ b/test/helm/gateway-crds-helm/all.out.yaml @@ -23384,6 +23384,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -26566,6 +26574,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -40188,6 +40204,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -41387,6 +41411,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -42667,6 +42699,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -43860,6 +43900,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the @@ -46030,6 +46078,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -47119,6 +47175,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -48424,6 +48488,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -49777,6 +49849,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. diff --git a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml index 9065f74a1a0..c547fe9c549 100644 --- a/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml +++ b/test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml @@ -2728,6 +2728,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -5910,6 +5918,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -19532,6 +19548,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -20731,6 +20755,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire @@ -22011,6 +22043,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -23204,6 +23244,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the @@ -25374,6 +25422,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -26463,6 +26519,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream. @@ -27768,6 +27832,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received @@ -29121,6 +29193,14 @@ spec: Default: unlimited. pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + maxStreamDuration: + description: |- + MaxStreamDuration is the maximum duration for a stream to complete. This timeout measures the time + from when the request is sent until the response stream is fully consumed and does not apply to + non-streaming requests. + When set to "0s", no max duration is applied and streams can run indefinitely. + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string requestTimeout: description: RequestTimeout is the time until which entire response is received from the upstream.