This simple aim of the project is to test if a container's load is getting balanced across cluster. For Demonstration we will use DOCKER SWARM to simulate cluster environment which will load balance our requests.
- Docker Engine
- Docker Desktop (optional)
- Portainer Conatiner (optional/UI for Clusters)
Clone the project
git clone https://github.com/dknaix/Load-balancer-tester.git
Go to the project directory
cd Load-balancer-tester
Build Image from Dockerfile
docker build -t flask-lb-tester:v1.0 .
Initialise Docker Swarm
docker swarm init
Create Service
docker service create --replicas 3 --name flask-lb-tester -p 5000:5000 flask-lb-tester:v1.0
curl http://localhost:5000
If the Container-ID changes after every request means the load is getting balanced, if not meaning there is some misconfiguration.
flask-lb-tester is a light-weight images to quickly test if the a container/pod is getting balanced in a cluster environment. You can build your own version or use build the image from provided Dockerfile.