Backend service with a list of faults that are applied for frontend service
Backend service with a list of faults that are applied for frontend service
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshFaultInjection
metadata:
name: default-fault-injection
namespace: kuma-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
from:
- targetRef:
kind: MeshSubset
tags:
kuma.io/service: frontend
default:
http:
- abort:
httpStatus: 500
percentage: '2.5'
- abort:
httpStatus: 500
percentage: 10
- delay:
value: 5s
percentage: 5
Copied!
type: MeshFaultInjection
mesh: default
name: default-fault-injection
spec:
targetRef:
kind: Dataplane
labels:
app: backend
from:
- targetRef:
kind: MeshSubset
tags:
kuma.io/service: frontend
default:
http:
- abort:
httpStatus: 500
percentage: '2.5'
- abort:
httpStatus: 500
percentage: 10
- delay:
value: 5s
percentage: 5
Copied!
Please adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_fault_injection" "default_fault_injection" {
provider = konnect-beta
type = "MeshFaultInjection"
name = "default-fault-injection"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "backend"
}
}
from = [
{
target_ref = {
kind = "MeshSubset"
tags = {
kuma.io/service = "frontend"
}
}
default = {
http = [
{
abort = {
http_status = "500"
percentage = "2.5"
}
},
{
abort = {
http_status = "500"
percentage = "10"
}
},
{
delay = {
value = "5s"
percentage = "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!