Delay requests to test caller timeouts
Wait five seconds before forwarding 50.5% of requests to the application, to test whether the caller times out as expected.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshFaultInjection
metadata:
name: backend-delay
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- default:
http:
- delay:
value: 5s
percentage: '50.5'Copied!
type: MeshFaultInjection
name: backend-delay
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- default:
http:
- delay:
value: 5s
percentage: '50.5'Copied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_fault_injection" "backend_delay" {
provider = konnect-beta
type = "MeshFaultInjection"
name = "backend-delay"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "backend"
}
}
rules = [
{
default = {
http = [
{
delay = {
value = "5s"
percentage = { str = "50.5" }
}
}
]
}
}
]
}
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!