This is a simple round-robin load balancer implemented in Go.
The load balancer distributes incoming HTTP requests across a list of backend servers in a round-robin fashion.
- Go installed
.env
file with server addresses
SERVERS=Server1,Server2,Server3
-
Clone the repository:
git clone https://github.com/omarsoufiane/go-load-balancer.git cd go-load-balancer
Running Locally
go run main.go The load balancer will start running on port 8080.
Running with Docker Build the Docker image:
docker build -t go-load-balancer . Run the Docker container:
docker run -p 8080:8080 go-load-balancer The load balancer will be accessible on port 8080 within the Docker container.
To change the server addresses, modify the .env file and update the SERVERS variable. SERVERS=Server1,Server2,Server3
no kubernetes yet
Contributions are welcome! Feel free to open issues or submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.