1
0
Fork 0
No description
Find a file
Joao Gilberto Magalhaes 3b8818e636
Merge pull request #68 from byjg/dependabot/uv/cryptography-46.0.5
Bump cryptography from 46.0.4 to 46.0.5
2026-02-18 17:57:20 -05:00
.github Add Docker build and cache cleanup steps in CI, prevent redundant builds in Swarm E2E tests 2026-02-18 16:42:44 -05:00
.run Migrate configuration paths to /etc/easyhaproxy and improve health check support in E2E tests 2026-02-15 14:32:16 -05:00
.vscode Fix errors in the test 2023-02-08 19:27:50 -06:00
deploy Prepare version 6.0.0 2026-02-18 17:38:46 -05:00
docs Prepare version 6.0.0 2026-02-18 17:38:46 -05:00
helm/easyhaproxy Prepare version 6.0.0 2026-02-18 17:38:46 -05:00
scripts Prepare version 6.0.0 2026-02-18 17:38:46 -05:00
src Update plugin paths from /etc/haproxy to /etc/easyhaproxy across tests, configs, and documentation 2026-02-18 16:35:57 -05:00
tests Update plugin paths from /etc/haproxy to /etc/easyhaproxy across tests, configs, and documentation 2026-02-18 16:35:57 -05:00
tests_e2e Prepare version 6.0.0 2026-02-18 17:38:46 -05:00
.dockerignore Minor changes in github actions 2022-08-26 16:05:18 -05:00
.gitignore Refactor Dockerfile for multi-stage build and runtime optimization 2026-02-18 01:53:27 -05:00
.python-version Modernizing PyThon Projec 2026-01-22 20:14:22 -05:00
build-multiarch.sh Migrate build assets and scripts to deploy/docker structure 2026-02-18 02:58:32 -05:00
CONTRIBUTING.md Update CONTRIBUTING.md 2024-06-04 21:31:19 -05:00
LICENSE Initial Commit 2018-09-16 21:03:17 -05:00
Makefile Migrate build assets and scripts to deploy/docker structure 2026-02-18 02:58:32 -05:00
pyproject.toml Prepare version 6.0.0 2026-02-18 17:38:46 -05:00
README.md Migrate examples to tests_e2e directory structure 2026-02-12 17:05:04 -05:00
RELEASE.md Bump version to 6.0.0 and update release notes for major changes 2026-02-18 14:14:51 -05:00
uv.lock Bump cryptography from 46.0.4 to 46.0.5 2026-02-18 22:52:00 +00:00

EasyHAProxy

Sponsor Opensource ByJG Build Status GitHub source GitHub license GitHub release Helm Version Artifact Hub

EasyHAProxy

Service discovery for HAProxy

EasyHAProxy dynamically creates the haproxy.cfg based on metadata collected from your workloads (Docker labels, Swarm service labels, or Kubernetes ingress annotations).

EasyHAProxy can detect and configure HAProxy automatically on the following platforms:

  • Docker
  • Docker Swarm
  • Kubernetes
  • Static YAML definitions (EASYHAPROXY_DISCOVER=static)

Who is using?

EasyHAProxy is part of some projects:

  • Dokku
  • MicroK8s
  • DigitalOcean Marketplace

See detailed instructions on how to install below.

EasyHAProxy Mission

Easy to set up and low configuration to numerous features.

Features

EasyHAProxy will discover services based on Docker (or Swarm) labels and Kubernetes ingress annotations, then dynamically build the haproxy.cfg. Below, EasyHAProxy main features:

  • Support Automatic Certificate Management Environment (ACME) protocol compatible with Let's Encrypt and other CAs.
  • Set your custom SSL certificates
  • Balance traffic between multiple replicas
  • Set SSL policies (strict, default, loose) via EASYHAPROXY_SSL_MODE.
  • 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:

Kubernetes Docker Swarm Docker Static

Or you can install using tools:

Helm MicroK8s Dokku DigitalOcean

Special Topics

If you already set up the EasyHAProxy, is time to go deeper:

Configuration Reference

Detailed configuration guides for advanced setups:

Development

Requirements

  • Python 3.11 or higher
  • uv package manager

Installation for Development

# Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone https://github.com/byjg/docker-easy-haproxy.git
cd docker-easy-haproxy

# Install dependencies (creates virtual environment automatically)
uv sync --dev

# Run tests
make test
# or directly: uv run pytest tests/ -vv

# Run linting
make lint

# Format code
make format

Installing the Package

# Install with uv
uv pip install easymapping

# Or install from source
uv pip install -e ".[dev]"

See EasyHAProxy in action

Click on the image to see the videos (use HD for better visualization)

Docker In Action Docker and Letsencrypt K8s In Action K8s and Letsencrypt Static Configuration TCP Mode

Here is the code applied in the test examples above.


Open source ByJG