ic-http-lb is the simple HTTP load balancer that runs in front of HTTP Gateways on the Internet Computer.
ic-http-lb enables load balancing of incoming HTTP requests over a set of backends and performs TLS termination.
To install and set up ic-http-lb, follow the steps below.
- Grab the latest package from the releases page and install it
- Edit
/etc/default/ic-http-lbfile to configure the service using environment variables. SeeUsagesection below. - Start the service with
systemctl start ic-http-lb
-
Clone the repository
git clone git@github.com:dfinity/ic-http-lb.git cd ic-http-lb -
Install Rust
Follow the official Rust installation guide.
-
Build
Execute
cargo build --releasein theic-http-lbfolder and you'll get a binary intarget/releasesubfolder.
- Install repro-env
- Build the binary using
repro-env build -- cargo build --release --target x86_64-unknown-linux-musl
- Pull the container:
docker pull ghcr.io/dfinity/ic-http-lb:latest - Create the configuration file with the environment variables, e.g.
ic-http-lb.env - Run the container:
docker run --env-file ic-http-lb.env ghcr.io/dfinity/ic-http-lb
To run a minimal ic-http-lb instance, use the following configuration in /etc/default/ic-http-lb:
CONFIG_PATH="/etc/ic-http-lb/config.yaml"
config.yaml example:
strategy: wrr
backends:
- name: host1
url: http://host1
weight: 1
enabled: true
- name: host2
url: http://host2
weight: 2
enabled: true
ic-http-lb offers various options that can be configured via command-line arguments or environment variables. For a full list, run ic-http-lb --help.
External code contributions are currently not being accepted to this repository.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.