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

docs: highlight default 15s request timeout #3529

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion site/content/en/latest/tasks/traffic/http-timeouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
title: "HTTP Timeouts"
---

The [HTTPRouteTimeouts][] resource allows users to configure request timeouts and response timeouts for an [HTTPRouteRule][]. This task shows how to configure timeouts.
The default request timeout is set to 15 seconds in Envoy Proxy.
The [HTTPRouteTimeouts][] resource allows users to configure request timeouts for an [HTTPRouteRule][].
This task shows you how to configure timeouts.

The [HTTPRouteTimeouts][] supports two kinds of timeouts:
- **request**: Request specifies the maximum duration for a gateway to respond to an HTTP request.
Expand Down
80 changes: 79 additions & 1 deletion site/content/en/v1.0.1/tasks/traffic/http-timeouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
title: "HTTP Timeouts"
---

The [HTTPRouteTimeouts][] resource allows users to configure request timeouts and response timeouts for an [HTTPRouteRule][]. This guide shows how to configure timeouts.
The default request timeout is set to 15 seconds in Envoy Proxy.
The [HTTPRouteTimeouts][] resource allows users to configure request timeouts for an [HTTPRouteRule][].
This task shows you how to configure timeouts.

The [HTTPRouteTimeouts][] supports two kinds of timeouts:
- **request**: Request specifies the maximum duration for a gateway to respond to an HTTP request.
Expand All @@ -22,6 +24,9 @@ backend has the ability to delay responses; we use it as the backend to control
### request timeout
We configure the backend to delay responses by 3 seconds, then we set the request timeout to 4 seconds. Envoy Gateway will successfully respond to the request.

{{< tabpane text=true >}}
{{% tab header="Apply from stdin" %}}

```shell
cat <<EOF | kubectl apply -f -
apiVersion: gateway.networking.k8s.io/v1
Expand Down Expand Up @@ -51,6 +56,41 @@ spec:
EOF
```

{{% /tab %}}
{{% tab header="Apply from file" %}}
Save and apply the following resource to your cluster:

```yaml
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: backend
spec:
hostnames:
- timeout.example.com
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: eg
rules:
- backendRefs:
- group: ""
kind: Service
name: backend
port: 3000
weight: 1
matches:
- path:
type: PathPrefix
value: /
timeouts:
request: "4s"
```

{{% /tab %}}
{{< /tabpane >}}

```shell
curl --header "Host: timeout.example.com" http://${GATEWAY_HOST}/?delay=3s -I
```
Expand All @@ -65,6 +105,9 @@ content-length: 480

Then we set the request timeout to 2 seconds. In this case, Envoy Gateway will respond with a timeout.

{{< tabpane text=true >}}
{{% tab header="Apply from stdin" %}}

```shell
cat <<EOF | kubectl apply -f -
apiVersion: gateway.networking.k8s.io/v1
Expand Down Expand Up @@ -94,6 +137,41 @@ spec:
EOF
```

{{% /tab %}}
{{% tab header="Apply from file" %}}
Save and apply the following resource to your cluster:

```yaml
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: backend
spec:
hostnames:
- timeout.example.com
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: eg
rules:
- backendRefs:
- group: ""
kind: Service
name: backend
port: 3000
weight: 1
matches:
- path:
type: PathPrefix
value: /
timeouts:
request: "2s"
```

{{% /tab %}}
{{< /tabpane >}}

```shell
curl --header "Host: timeout.example.com" http://${GATEWAY_HOST}/?delay=3s -v
```
Expand Down
Loading