feat: add readIdleTimeout and pingTimeout config options to ServersTransport
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
parent
8e32d1913b
commit
1f17731369
14 changed files with 204 additions and 38 deletions
|
@ -52,23 +52,40 @@ spec:
|
|||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: The amount of time to wait until a connection to
|
||||
a backend server can be established. If zero, no timeout exists.
|
||||
description: DialTimeout is the amount of time to wait until a
|
||||
connection to a backend server can be established. If zero,
|
||||
no timeout exists.
|
||||
x-kubernetes-int-or-string: true
|
||||
idleConnTimeout:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: The maximum period for which an idle HTTP keep-alive
|
||||
connection will remain open before closing itself.
|
||||
description: IdleConnTimeout is the maximum period for which an
|
||||
idle HTTP keep-alive connection will remain open before closing
|
||||
itself.
|
||||
x-kubernetes-int-or-string: true
|
||||
pingTimeout:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: PingTimeout is the timeout after which the HTTP/2
|
||||
connection will be closed if a response to ping is not received.
|
||||
x-kubernetes-int-or-string: true
|
||||
readIdleTimeout:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: ReadIdleTimeout is the timeout after which a health
|
||||
check using ping frame will be carried out if no frame is received
|
||||
on the HTTP/2 connection. If zero, no health check is performed.
|
||||
x-kubernetes-int-or-string: true
|
||||
responseHeaderTimeout:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: The amount of time to wait for a server's response
|
||||
headers after fully writing the request (including its body,
|
||||
if any). If zero, no timeout exists.
|
||||
description: ResponseHeaderTimeout is the amount of time to wait
|
||||
for a server's response headers after fully writing the request
|
||||
(including its body, if any). If zero, no timeout exists.
|
||||
x-kubernetes-int-or-string: true
|
||||
type: object
|
||||
insecureSkipVerify:
|
||||
|
|
|
@ -324,7 +324,7 @@ serversTransport:
|
|||
|
||||
`forwardingTimeouts` is about a number of timeouts relevant to when forwarding requests to the backend servers.
|
||||
|
||||
#### forwardingTimeouts.dialTimeout`
|
||||
#### `forwardingTimeouts.dialTimeout`
|
||||
|
||||
_Optional, Default=30s_
|
||||
|
||||
|
@ -349,7 +349,7 @@ serversTransport:
|
|||
--serversTransport.forwardingTimeouts.dialTimeout=1s
|
||||
```
|
||||
|
||||
#### forwardingTimeouts.responseHeaderTimeout`
|
||||
#### `forwardingTimeouts.responseHeaderTimeout`
|
||||
|
||||
_Optional, Default=0s_
|
||||
|
||||
|
@ -376,7 +376,7 @@ serversTransport:
|
|||
--serversTransport.forwardingTimeouts.responseHeaderTimeout=1s
|
||||
```
|
||||
|
||||
#### forwardingTimeouts.idleConnTimeout`
|
||||
#### `forwardingTimeouts.idleConnTimeout`
|
||||
|
||||
_Optional, Default=90s_
|
||||
|
||||
|
|
|
@ -876,6 +876,78 @@ spec:
|
|||
idleConnTimeout: "1s"
|
||||
```
|
||||
|
||||
##### `forwardingTimeouts.readIdleTimeout`
|
||||
|
||||
_Optional, Default=0s_
|
||||
|
||||
`readIdleTimeout` is the timeout after which a health check using ping frame will be carried out
|
||||
if no frame is received on the HTTP/2 connection.
|
||||
Note that a ping response will be considered a received frame,
|
||||
so if there is no other traffic on the connection,
|
||||
the health check will be performed every `readIdleTimeout` interval.
|
||||
If zero, no health check is performed.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
## Dynamic configuration
|
||||
http:
|
||||
serversTransports:
|
||||
mytransport:
|
||||
forwardingTimeouts:
|
||||
readIdleTimeout: "1s"
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
## Dynamic configuration
|
||||
[http.serversTransports.mytransport.forwardingTimeouts]
|
||||
readIdleTimeout = "1s"
|
||||
```
|
||||
|
||||
```yaml tab="Kubernetes"
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: ServersTransport
|
||||
metadata:
|
||||
name: mytransport
|
||||
namespace: default
|
||||
|
||||
spec:
|
||||
forwardingTimeouts:
|
||||
readIdleTimeout: "1s"
|
||||
```
|
||||
|
||||
##### `forwardingTimeouts.pingTimeout`
|
||||
|
||||
_Optional, Default=15s_
|
||||
|
||||
`pingTimeout` is the timeout after which the HTTP/2 connection will be closed
|
||||
if a response to ping is not received.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
## Dynamic configuration
|
||||
http:
|
||||
serversTransports:
|
||||
mytransport:
|
||||
forwardingTimeouts:
|
||||
pingTimeout: "1s"
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
## Dynamic configuration
|
||||
[http.serversTransports.mytransport.forwardingTimeouts]
|
||||
pingTimeout = "1s"
|
||||
```
|
||||
|
||||
```yaml tab="Kubernetes"
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: ServersTransport
|
||||
metadata:
|
||||
name: mytransport
|
||||
namespace: default
|
||||
|
||||
spec:
|
||||
forwardingTimeouts:
|
||||
pingTimeout: "1s"
|
||||
```
|
||||
|
||||
### Weighted Round Robin (service)
|
||||
|
||||
The WRR is able to load balance the requests between multiple services based on weights.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue