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

feat(api): add idleTimeout to ClientTrafficPolicy for TCP listener #3345

Merged
merged 7 commits into from
May 15, 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
14 changes: 14 additions & 0 deletions api/v1alpha1/timeout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,26 @@ type HTTPTimeout struct {
}

type ClientTimeout struct {
// Timeout settings for TCP.
//
// +optional
TCP *TCPClientTimeout `json:"tcp,omitempty"`

// Timeout settings for HTTP.
//
// +optional
HTTP *HTTPClientTimeout `json:"http,omitempty"`
}

type TCPClientTimeout struct {
// IdleTimeout for a TCP connection. Idle time is defined as a period in which there are no
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that this will be implemented for the envoy TCP Proxy, right? Maybe we should state that these settings only apply to tcproute, tlsroute resources, so that users don't expect this timeout to apply also in case of HTTP (over TCP) connections?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the state will be necessary to clear confusion. TCPClientTimeout can only be applied on listener whose protocol is TCP or TLS, it'll be used to set Envoy TCP Proxy's idle timeout eventually.

// bytes sent or received on either the upstream or downstream connection.
// Default: 1 hour.
//
// +optional
IdleTimeout *gwapiv1.Duration `json:"idleTimeout,omitempty"`
}

type HTTPClientTimeout struct {
// RequestReceivedTimeout is the duration envoy waits for the complete request reception. This timer starts upon request
// initiation and stops when either the last byte of the request is sent upstream or when the response begins.
Expand Down
25 changes: 25 additions & 0 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 @@ -348,6 +348,17 @@ spec:
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
type: string
type: object
tcp:
description: Timeout settings for TCP.
properties:
idleTimeout:
description: |-
IdleTimeout for a TCP connection. Idle time is defined as a period in which there are no
bytes sent or received on either the upstream or downstream connection.
Default: 1 hour.
pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$
type: string
type: object
type: object
tls:
description: TLS settings configure TLS termination settings with
Expand Down
15 changes: 15 additions & 0 deletions site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ _Appears in:_

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tcp` | _[TCPClientTimeout](#tcpclienttimeout)_ | false | Timeout settings for TCP. |
| `http` | _[HTTPClientTimeout](#httpclienttimeout)_ | false | Timeout settings for HTTP. |


Expand Down Expand Up @@ -3062,6 +3063,20 @@ _Appears in:_
| `receive` | _[ActiveHealthCheckPayload](#activehealthcheckpayload)_ | false | Receive defines the expected response payload. |


#### TCPClientTimeout





_Appears in:_
- [ClientTimeout](#clienttimeout)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `idleTimeout` | _[Duration](#duration)_ | false | IdleTimeout for a TCP connection. Idle time is defined as a period in which there are no<br />bytes sent or received on either the upstream or downstream connection.<br />Default: 1 hour. |


#### TCPKeepalive


Expand Down
Loading