Allow one client a longer request timeout
Match a rule on the calling SPIFFE ID to raise the request timeout for one group of clients. Only requestTimeout and streamIdleTimeout can be conditioned on identity.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshTimeout
metadata:
name: backend-from-frontend
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- matches:
- spiffeID:
type: Prefix
value: spiffe://default.default.mesh.local/ns/kong-mesh-demo/sa
default:
http:
requestTimeout: 45sCopied!
type: MeshTimeout
name: backend-from-frontend
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- matches:
- spiffeID:
type: Prefix
value: spiffe://default.default.mesh.local/ns/kong-mesh-demo/sa
default:
http:
requestTimeout: 45sCopied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_timeout" "backend_from_frontend" {
provider = konnect-beta
type = "MeshTimeout"
name = "backend-from-frontend"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "backend"
}
}
rules = [
{
matches = [
{
spiffe_id = {
type = "Prefix"
value = "spiffe://default.default.mesh.local/ns/kong-mesh-demo/sa"
}
}
]
default = {
http = {
request_timeout = "45s"
}
}
}
]
}
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!