Kuadrant / Kuadrant/kuadrant-operator
Add Kuadrant/TokenRateLimitPolicy reservation fields and Reserve/Commit reconciler branch
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 94
- Forks
- 89
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 43
Description
Summary
Add the cluster-wide mode switch and per-limit reservation CRD fields, plus the reconciler logic that generates Reserve/Commit wasm actions (Reservation mode) or today's Check/Report actions (CheckReport mode).
Design: RFC 0021, reference-level section "Expected work by component" (kuadrant-operator).
Depends on: Kuadrant/wasm-shim#402 (RateLimitReserve/RateLimitCommit service types).
Acceptance Criteria
-
KuadrantCR fieldspec.tokenRateLimiting.mode(enumReservation/CheckReport, defaultReservation) -
TokenRateLimitPolicyper-limitreservationfield (amount,ttlCEL expressions), including defaults/overrides merge behavior across the policy hierarchy - Default
amount/ttlCEL generation for limits that omitreservation: flatuint(5000)for amount, route'sHTTPRoute.spec.rules[].timeouts.backendRequestfor ttl - Reconciler branch generating the correct wasm actions based on effective state:
- Effectively active:
Reserveaction (ServiceType::RateLimitReserve) at request phase +Commitaction (ServiceType::RateLimitCommit) at response/stream-end phase - The
reservation_idreturned by theReservecall is captured (via anon_reply→Storeaction intostored_values) and reused in theCommitaction's request. Per wasm-shim#402 this capture/reuse is entirely configuration-driven, so the operator must generate the wasm config that stores the id from the Reserve reply and passes it back onCommit. - Effectively inactive: today's
ratelimit-check-service(hits_addend=0) +ratelimit-report-service(hits_addend=<actual>)
- Effectively active:
- Regular
RateLimitPolicyreconciliation path is untouched (separate code, verified by existing tests still passing) - Docs covering both modes
- E2e tests covering both modes and the upgrade-window transition (old Limitador/operator without reservation support)
Notes for reviewers
PR description should include: how to review (suggested order: CRD field additions → default CEL generation → reconciler branching → e2e), and manual verification (apply a TokenRateLimitPolicy in each mode, inspect generated wasm plugin config for the expected actions).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RFC 0021 and its kuadrant-operator “Expected work by component” section, then inspect the Kuadrant and TokenRateLimitPolicy CRD definitions and reconciler entry points. Done means both modes, reservation defaults and merges, wasm Reserve/Commit configuration, existing regular RateLimitPolicy behavior, documentation, and the specified e2e and upgrade-transition coverage are implemented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, wasm
- Domain
- backend-api-design, devops, documentation, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100