Fail requests instead of sending them to unhealthy endpoints
Set failTrafficOnPanic so a cluster in panic mode rejects requests rather than routing them to endpoints already known to be failing.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshHealthCheck
metadata:
name: web-to-backend-panic
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:
interval: 10s
timeout: 2s
failTrafficOnPanic: true
http:
path: "/health"Copied!
type: MeshHealthCheck
name: web-to-backend-panic
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
interval: 10s
timeout: 2s
failTrafficOnPanic: true
http:
path: "/health"Copied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_health_check" "web_to_backend_panic" {
provider = konnect-beta
type = "MeshHealthCheck"
name = "web-to-backend-panic"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "web"
}
}
to = [
{
target_ref = {
kind = "MeshService"
labels = {
"kuma.io/display-name" = "backend"
}
}
default = {
interval = "10s"
timeout = "2s"
fail_traffic_on_panic = true
http = {
path = "/health"
}
}
}
]
}
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!