Skip to content

Commit

Permalink
feat(api): add idleTimeout to ClientTrafficPolicy for TCP listener (e…
Browse files Browse the repository at this point in the history
…nvoyproxy#3345)

* Add tcp idle timeout api

Signed-off-by: Dingkang Li <dingkang1743@gmail.com>

* State tcp client timeout usage

Signed-off-by: Dingkang Li <dingkang1743@gmail.com>

---------

Signed-off-by: Dingkang Li <dingkang1743@gmail.com>
  • Loading branch information
aoledk authored May 15, 2024
1 parent 16f1b43 commit 6912dc0
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api/v1alpha1/timeout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,27 @@ 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"`
}

// TCPClientTimeout only provides timeout configuration on the listener whose protocol is TCP or TLS.
type TCPClientTimeout struct {
// 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.
//
// +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 @@ -518,6 +518,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 @@ -3263,6 +3264,20 @@ _Appears in:_
| `receive` | _[ActiveHealthCheckPayload](#activehealthcheckpayload)_ | false | Receive defines the expected response payload. |


#### TCPClientTimeout



TCPClientTimeout only provides timeout configuration on the listener whose protocol is TCP or TLS.

_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

0 comments on commit 6912dc0

Please sign in to comment.