https://github.com/pyaillet/aya-lb-dr
A minimal example of using aya to build a loadbalancer with direct return
https://github.com/pyaillet/aya-lb-dr
aya ebpf example learning-exercise rust-lang
Last synced: 4 months ago
JSON representation
A minimal example of using aya to build a loadbalancer with direct return
- Host: GitHub
- URL: https://github.com/pyaillet/aya-lb-dr
- Owner: pyaillet
- Created: 2024-03-31T17:21:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-01T19:38:24.000Z (about 2 years ago)
- Last Synced: 2025-10-30T14:52:43.425Z (7 months ago)
- Topics: aya, ebpf, example, learning-exercise, rust-lang
- Language: Rust
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lb-dr
Experiment using [eBPF](https://ebpf.io/) and [aya-rs](https://aya-rs.dev/) to build a simple load balancer with direct return.
## How to use
There is an example setup with [containerlab](https://containerlab.dev/) in the `./test/` directory.
You can deploy all what's necessary with `make deploy` (which is the default make target).
You can then test a request from the `client` container to the VIP:
```bash
docker container exec clab-aya-lb-dr-client curl --silent --head 192.168.31.50
```
### Prerequisites
1. Install bpf-linker: `cargo install bpf-linker`
2. Install [containerlab](https://containerlab.dev/install/)
### Build eBPF
```bash
cargo xtask build-ebpf
```
To perform a release build you can use the `--release` flag.
You may also change the target architecture with the `--target` flag.
### Build Userspace
```bash
cargo build
```
### Deploy the example lab
Check the make targets and use the default one:
`make deploy`