Limitador is a generic rate-limiter written in Rust. It can be used as a library, or as a service. The service exposes HTTP endpoints to apply and observe limits. Limitador can be used with Envoy because it also exposes a grpc service, on a different port, that implements the Envoy Rate Limit protocol (v3).
- Getting started
- How it works
- Configuration
- Development
- Testing Environment
- Kubernetes
- Contributing
- License
Limitador is under active development, and its API has not been stabilized yet.
Add this to your Cargo.toml:
[dependencies]
limitador = { version = "0.3.0" }For more information, see the README of the crate
Run with Docker (replace latest with the version you want):
docker run --rm --net=host -it quay.io/kuadrant/limitador:v1.0.0Run locally:
cargo run --release --bin limitador-server -- --helpRefer to the help message on how to start up the server. More information are available
in the server's README.md
cargo buildSome tests need a Redis (>= 7.0) deployed in localhost:6379. You can run it in Docker with:
docker run --rm -p 6379:6379 -it redis:7Then, run the tests:
cargo test --all-featuresor you can run tests disabling the "redis storage" feature:
cd limitador; cargo test --no-default-featuresEvery action referenced from .github/workflows must be pinned to an immutable commit SHA, since tags can be
force-pushed by their maintainers. This is enforced by the verify-ratchet CI check, which is backed by
ratchet.
Check if every github action is properly pinned, the same way CI does it:
make verify-ratchetIf you add or change an action reference, pin it before pushing:
make ratchet-pinPinned references are refreshed monthly by the ratchet-update workflow.
Join us on the #kuadrant channel in the Kubernetes Slack workspace, for live discussions about the roadmap and more.