https://github.com/byjg/docker-easy-haproxy
Discover services and create dynamically the haproxy.cfg based on the labels defined in docker containers or from a simple static Yaml
https://github.com/byjg/docker-easy-haproxy
discovery-service dynamic-configuration haproxy haproxy-configuration haproxy-docker ssl
Last synced: 2 months ago
JSON representation
Discover services and create dynamically the haproxy.cfg based on the labels defined in docker containers or from a simple static Yaml
- Host: GitHub
- URL: https://github.com/byjg/docker-easy-haproxy
- Owner: byjg
- License: mit
- Created: 2018-09-17T02:04:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-04-16T18:58:32.000Z (3 months ago)
- Last Synced: 2025-04-17T01:37:58.798Z (3 months ago)
- Topics: discovery-service, dynamic-configuration, haproxy, haproxy-configuration, haproxy-docker, ssl
- Language: Python
- Homepage:
- Size: 1.68 MB
- Stars: 62
- Watchers: 4
- Forks: 13
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# EasyHAProxy
[](http://opensource.byjg.com)
[](https://github.com/byjg/docker-easy-haproxy/actions/workflows/build.yml)
[](https://github.com/byjg/docker-easy-haproxy/)
[](https://opensource.byjg.com/opensource/licensing.html)
[](https://github.com/byjg/docker-easy-haproxy/releases/)
[](https://opensource.byjg.com/helm)
## Service discovery for HAProxy
EasyHAProxy dynamically creates the `haproxy.cfg` based on the labels defined in docker containers.
EasyHAProxy can detect and configure HAProxy automatically on the following platforms:
- Docker
- Docker Swarm
- Kubernetes## Who is using?
EasyHAProxy is part of some projects:
- Dokku
- MicroK8s
- DigitalOcean MarketplaceSee detailed instructions on how to install below.
## EasyHAProxy Mission
Easy to set up and low configuration to numerous features.
## Features
EasyHAProxy will discover the services based on the Docker Tags of the containers running on a Docker host or Docker Swarm cluster and dynamically set up the `haproxy.cfg`. Below, EasyHAProxy main features:
- Support Automatic Certificate Management Environment (ACME) protocol compatible with Let's encrypt and others CA.
- Set your custom SSL certificates
- Balance traffic between multiple replicas
- Set SSL with three different levels of validations and according to the most recent definitions.
- Set up HAProxy to listen to TCP.
- Add redirects.
- Enable/disable Stats on port 1936 with a custom password.
- Enable/disable custom errors.Also, it is possible to set up HAProxy from a simple Yaml file instead of creating `haproxy.cfg` file.
## How Does It Work?
You don't need to change your current infrastructure and don't need to learn the HAProxy configuration.
The steps are:
- Run the EasyHAProxy container;
- Add some labels to the containers you want to be parsed by EasyHAProxy (see detailed instructions below);
- EasyHAProxy will automatically detect the containers, set up, and reload the HAProxy configurations for you without downtime.## Detailed Instructions
For detailed instructions on how to use EasyHAProxy, follow the instructions for the platform you want to use:
[](docs/kubernetes.md)
[](docs/swarm.md)
[](docs/docker.md)
[](docs/static.md)Or you can install using tools:
[](docs/helm.md)
[](docs/microk8s.md)
[](docs/dokku.md)
[](docs/digitalocean.md)## Special Topics
If you already set up the EasyHAProxy, is time to go deeper:
- [Custom SSL](docs/ssl.md)
- [Automatic Certificate Issuing](docs/acme.md) (e.g. Letsencrypt)## See EasyHAProxy in action
Click on the image to see the videos (use HD for better visualization)
[](https://youtu.be/ar8raFK0R1k)
[](https://youtu.be/xwIdj9mc2mU)
[](https://youtu.be/uq7TuLIijks)
[](https://youtu.be/v9Q4M5Al7AQ)
[](https://youtu.be/B_bYZnRTGJM)
[](https://youtu.be/JHqcq9crbDI)[Here is the code](https://gist.github.com/byjg/e125e478a0562190176d69ea795fd3d4) applied in the examples above.
----
[Open source ByJG](http://opensource.byjg.com)