Cap incoming connections to a service
Use MeshCircuitBreaker rules to limit the connections a proxy accepts, rather than the connections it opens to a destination.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshCircuitBreaker
metadata:
name: backend-inbound
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- default:
connectionLimits:
maxConnections: 100
maxPendingRequests: 50Copied!
type: MeshCircuitBreaker
name: backend-inbound
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- default:
connectionLimits:
maxConnections: 100
maxPendingRequests: 50Copied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_circuit_breaker" "backend_inbound" {
provider = konnect-beta
type = "MeshCircuitBreaker"
name = "backend-inbound"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "backend"
}
}
rules = [
{
default = {
connection_limits = {
max_connections = 100
max_pending_requests = 50
}
}
}
]
}
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!