Basic circuit breaker for outbound traffic
Basic circuit breaker for outbound traffic from web, to backend service
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshCircuitBreaker
metadata:
name: web-to-backend-circuit-breaker
namespace: kuma-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
name: backend_kuma-demo_svc_8080
default:
connectionLimits:
maxConnections: 2
maxPendingRequests: 8
maxRetries: 2
maxRequests: 2
apiVersion: kuma.io/v1alpha1
kind: MeshCircuitBreaker
metadata:
name: web-to-backend-circuit-breaker
namespace: kuma-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
name: backend
namespace: kuma-demo
sectionName: http
default:
connectionLimits:
maxConnections: 2
maxPendingRequests: 8
maxRetries: 2
maxRequests: 2
type: MeshCircuitBreaker
name: web-to-backend-circuit-breaker
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
name: backend
default:
connectionLimits:
maxConnections: 2
maxPendingRequests: 8
maxRetries: 2
maxRequests: 2
type: MeshCircuitBreaker
name: web-to-backend-circuit-breaker
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
name: backend
sectionName: http
default:
connectionLimits:
maxConnections: 2
maxPendingRequests: 8
maxRetries: 2
maxRequests: 2
Please adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_circuit_breaker" "web_to_backend_circuit_breaker" {
provider = konnect-beta
type = "MeshCircuitBreaker"
name = "web-to-backend-circuit-breaker"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "web"
}
}
to = [
{
target_ref = {
kind = "MeshService"
name = "backend"
section_name = "http"
}
default = {
connection_limits = {
max_connections = "2"
max_pending_requests = "8"
max_retries = "2"
max_requests = "2"
}
}
}
]
}
labels = {
"kuma.io/mesh" = konnect_mesh.my_mesh.name
}
cp_id = konnect_mesh_control_plane.my_meshcontrolplane.id
mesh = konnect_mesh.my_mesh.name
}