Exempt a client from a limit
Disable HTTP rate limiting for requests from one namespace, leaving the limit in place for everything else.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshRateLimit
metadata:
name: backend-exempt-monitoring
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- matches:
- spiffeID:
type: Prefix
value: spiffe://default.default.mesh.local/ns/observability/sa
default:
local:
http:
disabled: trueCopied!
type: MeshRateLimit
name: backend-exempt-monitoring
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: backend
rules:
- matches:
- spiffeID:
type: Prefix
value: spiffe://default.default.mesh.local/ns/observability/sa
default:
local:
http:
disabled: trueCopied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_rate_limit" "backend_exempt_monitoring" {
provider = konnect-beta
type = "MeshRateLimit"
name = "backend-exempt-monitoring"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "backend"
}
}
rules = [
{
matches = [
{
spiffe_id = {
type = "Prefix"
value = "spiffe://default.default.mesh.local/ns/observability/sa"
}
}
]
default = {
local = {
http = {
disabled = true
}
}
}
}
]
}
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!