haproxy/role¶
Configuration options for HAProxy backend services
HAProxy Node Role¶
This parameter defines whether a node acts as a load balancer or as a backend server in the HAProxy cluster. It is fundamental to service discovery and configuration.
Requirements¶
- Must be set on all nodes participating in the HAProxy cluster
- Role selection affects which other parameters are required
Usage¶
For load balancer nodes:
Additional required parameters: - haproxy/filters: to discover backend nodes - haproxy/frontend/config: recommended for service configurationFor backend nodes:
Additional required parameters: - haproxy/backend/services: to define available services - haproxy/backend/services/config: recommended for service configurationExample in cluster configuration:
cluster/machines:
load-balancer:
pipeline: universal-application-haproxy-server
names: ['lb01.local.domain']
Params:
haproxy/role: load-balancer
web-backend:
pipeline: universal-application-apache-web-server
names: ['web01.local.domain', 'web02.local.domain']
Params:
haproxy/role: backend