Set timeouts for requests a service receives
Use MeshTimeout rules to set the timeouts a proxy applies to inbound traffic, rather than to the traffic it sends.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshTimeout
metadata:
name: backend-inbound
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- default:
connectionTimeout: 10s
idleTimeout: 2h
http:
requestTimeout: 30sCopied!
type: MeshTimeout
name: backend-inbound
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- default:
connectionTimeout: 10s
idleTimeout: 2h
http:
requestTimeout: 30sCopied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_timeout" "backend_inbound" {
provider = konnect-beta
type = "MeshTimeout"
name = "backend-inbound"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "backend"
}
}
rules = [
{
default = {
connection_timeout = "10s"
idle_timeout = "2h"
http = {
request_timeout = "30s"
}
}
}
]
}
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!