Skip to content

haproxy/filters

Configuration options for HAProxy backend services

HAProxy Service Discovery Filters

This parameter defines the Digital Rebar Platform (DRP) filters used to discover backend nodes and their services. The filters are used by load balancer nodes during configuration to build the HAProxy configuration.

For detailed information about DRP filter syntax, refer to: https://docs.rackn.io/stable/developers/cli/filter/

Requirements

  • Must be set on load balancer nodes (haproxy/role = load-balancer)
  • Filter syntax must follow DRP filter rules
  • Filters should be specific enough to avoid matching unwanted nodes

Usage

Basic filter to find backend nodes:

haproxy/filters:
  - Params.haproxy/role=Eq(backend)

Filter combining multiple criteria:

haproxy/filters:
  - Profiles=Eq(universal-application-apache-web-server) Params.haproxy/role=Eq(backend)

Complex example with cluster-aware filtering:

haproxy/filters:
  - Profiles=Eq(universal-application-apache-web-server) Params.haproxy/role=Eq(backend) Profiles=Eq({{ .Machine.Name }})
  - Params.haproxy/role=Eq(backend) Profiles=Eq({{ .Machine.Name }})

The filters are used by the haproxy-configure.py script to: 1. Discover backend nodes 2. Collect their service configurations 3. Generate the appropriate HAProxy configuration