Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP2 settings API #3222

Merged
merged 12 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions api/v1alpha1/clienttrafficpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ type ClientTrafficPolicySpec struct {
//
// +optional
ClientIPDetection *ClientIPDetectionSettings `json:"clientIPDetection,omitempty"`
// HTTP3 provides HTTP/3 configuration on the listener.
//
// +optional
HTTP3 *HTTP3Settings `json:"http3,omitempty"`
// TLS settings configure TLS termination settings with the downstream client.
//
// +optional
Expand All @@ -75,10 +71,6 @@ type ClientTrafficPolicySpec struct {
//
// +optional
Path *PathSettings `json:"path,omitempty"`
// HTTP1 provides HTTP/1 configuration on the listener.
//
// +optional
HTTP1 *HTTP1Settings `json:"http1,omitempty"`
// HeaderSettings provides configuration for header management.
//
// +optional
Expand All @@ -91,6 +83,18 @@ type ClientTrafficPolicySpec struct {
//
// +optional
Connection *Connection `json:"connection,omitempty"`
// HTTP1 provides HTTP/1 configuration on the listener.
//
// +optional
HTTP1 *HTTP1Settings `json:"http1,omitempty"`
// HTTP2 provides HTTP/2 configuration on the listener.
//
// +optional
HTTP2 *HTTP2Settings `json:"http2,omitempty"`
// HTTP3 provides HTTP/3 configuration on the listener.
//
// +optional
HTTP3 *HTTP3Settings `json:"http3,omitempty"`
}

// HeaderSettings providess configuration options for headers on the listener.
Expand Down Expand Up @@ -200,6 +204,23 @@ type HTTP10Settings struct {
UseDefaultHost *bool `json:"useDefaultHost,omitempty"`
}

// HTTP2Settings provides HTTP/2 configuration on the listener.
type HTTP2Settings struct {
// InitialStreamWindowSize sets the initial window size for HTTP/2 streams.
zhaohuabing marked this conversation as resolved.
Show resolved Hide resolved
// If not set, the default value is 64 KiB(64*1024).
// +kubebuilder:validation:Minimum=65535
// +kubebuilder:validation:Maximum=2147483647
// +optional
InitialStreamWindowSize *uint32 `json:"initialStreamWindowSize,omitempty"`

// InitialConnectionWindowSize sets the initial window size for HTTP/2 connections.
// If not set, the default value is 1 MiB(1024*1024).
// +kubebuilder:validation:Minimum=65535
// +kubebuilder:validation:Maximum=2147483647
// +optional
InitialConnectionWindowSize *uint32 `json:"initialConnectionWindowSize,omitempty"`
zhaohuabing marked this conversation as resolved.
Show resolved Hide resolved
}

const (
// PolicyConditionOverridden indicates whether the policy has
// completely attached to all the sections within the target or not.
Expand Down
50 changes: 40 additions & 10 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,26 @@ spec:
By default, Envoy will lowercase all the headers.
type: boolean
type: object
http2:
description: HTTP2 provides HTTP/2 configuration on the listener.
properties:
initialConnectionWindowSize:
description: |-
InitialConnectionWindowSize sets the initial window size for HTTP/2 connections.
If not set, the default value is 1 MiB(1024*1024).
format: int32
maximum: 2147483647
minimum: 65535
type: integer
initialStreamWindowSize:
description: |-
InitialStreamWindowSize sets the initial window size for HTTP/2 streams.
If not set, the default value is 64 KiB(64*1024).
format: int32
maximum: 2147483647
minimum: 65535
type: integer
type: object
http3:
description: HTTP3 provides HTTP/3 configuration on the listener.
type: object
Expand Down
20 changes: 18 additions & 2 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,14 @@ _Appears in:_
| `tcpKeepalive` | _[TCPKeepalive](#tcpkeepalive)_ | false | TcpKeepalive settings associated with the downstream client connection.<br />If defined, sets SO_KEEPALIVE on the listener socket to enable TCP Keepalives.<br />Disabled by default. |
| `enableProxyProtocol` | _boolean_ | false | EnableProxyProtocol interprets the ProxyProtocol header and adds the<br />Client Address into the X-Forwarded-For header.<br />Note Proxy Protocol must be present when this field is set, else the connection<br />is closed. |
| `clientIPDetection` | _[ClientIPDetectionSettings](#clientipdetectionsettings)_ | false | ClientIPDetectionSettings provides configuration for determining the original client IP address for requests. |
| `http3` | _[HTTP3Settings](#http3settings)_ | false | HTTP3 provides HTTP/3 configuration on the listener. |
| `tls` | _[TLSSettings](#tlssettings)_ | false | TLS settings configure TLS termination settings with the downstream client. |
| `path` | _[PathSettings](#pathsettings)_ | false | Path enables managing how the incoming path set by clients can be normalized. |
| `http1` | _[HTTP1Settings](#http1settings)_ | false | HTTP1 provides HTTP/1 configuration on the listener. |
| `headers` | _[HeaderSettings](#headersettings)_ | false | HeaderSettings provides configuration for header management. |
| `timeout` | _[ClientTimeout](#clienttimeout)_ | false | Timeout settings for the client connections. |
| `connection` | _[Connection](#connection)_ | false | Connection includes client connection settings. |
| `http1` | _[HTTP1Settings](#http1settings)_ | false | HTTP1 provides HTTP/1 configuration on the listener. |
| `http2` | _[HTTP2Settings](#http2settings)_ | false | HTTP2 provides HTTP/2 configuration on the listener. |
| `http3` | _[HTTP3Settings](#http3settings)_ | false | HTTP3 provides HTTP/3 configuration on the listener. |


#### ClientValidationContext
Expand Down Expand Up @@ -1482,6 +1483,21 @@ _Appears in:_
| `http10` | _[HTTP10Settings](#http10settings)_ | false | HTTP10 turns on support for HTTP/1.0 and HTTP/0.9 requests. |


#### HTTP2Settings



HTTP2Settings provides HTTP/2 configuration on the listener.

_Appears in:_
- [ClientTrafficPolicySpec](#clienttrafficpolicyspec)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `initialStreamWindowSize` | _integer_ | false | InitialStreamWindowSize sets the initial window size for HTTP/2 streams.<br />If not set, the default value is 64 KiB(64*1024). |
| `initialConnectionWindowSize` | _integer_ | false | InitialConnectionWindowSize sets the initial window size for HTTP/2 connections.<br />If not set, the default value is 1 MiB(1024*1024). |


#### HTTP3Settings


Expand Down