Skip to main content

HAProxy (haproxy)

Load balancer of the replicated services: frontends and backends described as JSON, statistics page and Prometheus metrics.

Generated from catalog/services/haproxy.yaml: do not edit by hand.

Summary​

Version3.2.9
Useinstall and configure
Layerinfrastructure (shown apart)
CategoryGateways and load balancing
Installation methodspackage, podman
External connectionno
Sandbox onlyno

Licence​

SPDX identifierGPL-2.0-or-later
Licence policylicence exception
Licence exceptionLEX-004 (pending, awaiting the client)
Platform componenthaproxy

Packages and artifacts​

A package the project of the service publishes (its image, its binary archive, its Python or OS package) carries the licence of the service; a third-party package carries the licence written on its row, read from the official upstream metadata.

KindPackageVersionLicenceDetails
container imagedocker.io/library/haproxy3.2.9GPL-2.0-or-laterimage key haproxy, used by haproxy, digest sha256:7eb80a6c4555dd64fd5b01c078b33637b1af1871d636570624ef0b079857527e
OS packagehaproxyversion of the configured repositoryGPL-2.0-or-laterRHEL family (dnf)
OS packagehaproxyversion of the configured repositoryGPL-2.0-or-laterDebian family (apt)

Images are pinned by tag in the descriptor, and by digest when the descriptor declares one (the offline bundle then refuses a pulled image that does not carry it); the digest is recorded in the mirror of the Manager when the offline bundle is imported, and every pull or load is checked against it.

Supported systems and architectures​

MethodOperating systemsArchitectures
packageRHEL family (dnf), Debian family (apt)x86_64, aarch64 (not restricted by the descriptor)
podmanRHEL family (dnf), Debian family (apt), Arch Linux (pacman)x86_64, aarch64 (not restricted by the descriptor)

Certified host systems: RHEL 8/9/10, Rocky Linux 8/9/10, AlmaLinux 8/9/10, Oracle Linux 8/9, CentOS Stream 9/10, Ubuntu 22.04/24.04, Debian 12, Arch Linux (rolling). The host preflight accepts these systems (other releases of a known family give a warning, end of life releases are refused) and the x86_64 and aarch64 architectures.

Prerequisites​

Host​

The descriptor declares no host preflight check.

Programs the commands and checks of the service start on the host, outside the managed roots: add them to allowed_commands of the agent (see Security of the Navin agent), else the agent refuses them with command_not_allowed: /usr/sbin/haproxy.

Network and ports​

ComponentPort namePortOpened in the host firewall
haproxystats8404/tcpyes
haproxyfrontendfrontends[].bind_port/tcpyes

Kernel parameters​

ParameterValue
net.core.somaxconn4096
net.ipv4.ip_nonlocal_bind1

Services and connections needed​

This service has no dependency.

Installation methods and modes​

MethodDefaultWhat the method uses
packageyesthe OS packages of the descriptor, installed by the package manager of the host
podman-the container images of the descriptor, run by Podman under systemd

Components​

ComponentKindInstallation methodsPorts
HAProxy (haproxy)masterpackage, podman8404/tcp, frontends[].bind_port/tcp

Single (single) (default)​

One load balancer.

What the mode deploys:

ComponentPlacement
haproxymin 1, max 1

Active and standby pair (pair)​

Two identical load balancers sharing a virtual IP held by keepalived.

What the mode deploys:

ComponentPlacement
haproxymin 2, max 2

Install this service​

The install wizard of the Navin Manager plans, validates and runs the installation; you need the services:install permission on the cluster.

  1. Open the wizard. In Clusters, choose the row action Install services of the target cluster. The wizard opens on its first step, Service.

  2. Choose the service. On the Service step, select HAProxy. The card shows the licence GPL-2.0-or-later. Pick the Method among package, podman (default package).

  3. Choose the hosts and the mode. On the Hosts step, tick the hosts, then choose the Mode: single (default), pair. Each mode deploys the components listed in Installation methods and modes.

  4. Bindings. This service has no dependency: the Bindings step has nothing to bind.

  5. Configure. On the Configure step, review the parameters (see Configuration parameters). Passwords left empty with a generated default are generated and sealed by the Manager.

  6. Review and install. On the Install step the Manager validates the plan and shows the installation order; when it says "The plan is valid. Ready to install.", choose Install. A highly available mode is installed only when its HA checks pass.

  7. Verify. The operation ends when the health checks of every instance pass (see Health checks); the service then shows as running in Services.

High availability​

Clusterreplicas (replication)
High availabilityexternal (external)
Failovervirtual IP (vip)
Replicationnone (none)
QuorumVRRP (vrrp)
Discoverystatic (static)
Entry pointvirtual IP (vip)
Official documentationhttps://docs.haproxy.org/3.2/configuration.html

Prerequisites​

PrerequisiteMust be highly availableModesDescription
keepalivedyespairkeepalived on the same two hosts moves the virtual IP (VRRP).

Topology per mode​

ModesHighest catalog levelDistributionQuorum componentFault domainsDescription
singlestandalone (standalone)single (single)-1One load balancer: a single point of failure.
pairha (ha)active-passive (active-passive)-2Two identical load balancers; keepalived holds the virtual IP on one of them.

Notes​

  • HAProxy does not share its state between the two instances: connections in progress on the failed instance are cut, clients reconnect through the virtual IP.

Configuration parameters​

Routing​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Frontends and backends (frontends)json[]-nononoList of {name, bind_port, mode http|tcp, backend {balance, check_path, servers [host:port]}}; one frontend per entry, its bind_port published on the host. With the podman method, 127.0.0.1 in servers is the container itself: give the address of the host.
Statistics port (stats_port)port8404-nononoPort of the statistics page, /health and the Prometheus /metrics.

Tuning​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Maximum connections (maxconn)int20000min 256, max 1000000nonoyesGlobal connection limit.
Client timeout (timeout_client)duration300s-nononoInactivity timeout on the client side (long for streamed completions).
Server timeout (timeout_server)duration300s-nononoInactivity timeout on the server side.

Security​

ParameterTypeDefaultAllowed valuesRequiredSecretRestartDescription
Statistics user (stats_user)stringnavin-stats-nononoLogin of the statistics page (stats auth); /health and /metrics stay open to the probes.
Statistics password (stats_password)passwordgenerated-noyesnoPassword of the statistics page, generated at each install and kept in the Manager vault.
TLS (tls_enabled)boolfalse-nonoyesServe the statistics page, /health and /metrics over TLS with a certificate issued by the manager CA (the certificate and its key are joined at start in a 0600 file of the run directory, the form HAProxy reads).

Endpoints​

EndpointSchemeComponentPortPathTLS parameterBinding parametersBinding secretsProvisioning command
statshttphaproxy8404 (stats_port)-tls_enabled---

Commands​

CommandComponentTargetDescription
Validate the configuration (validate)haproxyevery hostRuns haproxy -c on the rendered configuration.
Reload (reload)haproxyevery hostReloads the configuration without dropping connections.

Health checks​

Liveness (per instance)​

ComponentCheckDetails
haproxyHTTP {{ ('https://' ~ host.fqdn) if config.tls_enabled else ('http://' ~ (host.ip or '127.0.0.1')) }}:{{ config.stats_port }}/healthExpected 200; 20 retries; interval 1 s; timeout 3 s

Preflight checks​

CheckTypeMeaningSeverityComponents
stats_port_freeport_free {"param": "stats_port"}port 8404 free on the hostblockingevery component

Uninstall​

Paths removed when the data is purged: {{ paths.log }}.

  • Statistics: {{ 'https' if config.tls_enabled else 'http' }}://{{ host.fqdn }}:{{ config.stats_port }}/stats

Upstream documentation​