Set timeouts for requests to a destination
Use MeshTimeout to set connection and request timeouts for the traffic a proxy sends to one destination.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshTimeout
metadata:
name: web-to-backend
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
connectionTimeout: 5s
idleTimeout: 1h
http:
requestTimeout: 15s
streamIdleTimeout: 30mCopied!
type: MeshTimeout
name: web-to-backend
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
connectionTimeout: 5s
idleTimeout: 1h
http:
requestTimeout: 15s
streamIdleTimeout: 30mCopied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_timeout" "web_to_backend" {
provider = konnect-beta
type = "MeshTimeout"
name = "web-to-backend"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "web"
}
}
to = [
{
target_ref = {
kind = "MeshService"
labels = {
"kuma.io/display-name" = "backend"
}
}
default = {
connection_timeout = "5s"
idle_timeout = "1h"
http = {
request_timeout = "15s"
stream_idle_timeout = "30m"
}
}
}
]
}
labels = {
"kuma.io/mesh" = konnect_mesh.my_mesh.name
}
cp_id = konnect_mesh_control_plane.my_meshcontrolplane.id
mesh = konnect_mesh.my_mesh.name
}
Copied!