Load balancing

A load balancer is a common system that uses the exported resources pattern in Puppet. Load balancers are used to forward traffic across multiple nodes, providing both high availability through redundancy and performance via horizontal scaling. Load balancers like HAProxy also allow for the design of applications that forward a user to data centers more local to them for performance.

The load balancer itself will receive a traditional configuration, while every member of the balancer will export a resource to be consumed by the load balancer. The load balancer then uses each entry from each exported resource to build a combined configuration file.

The following sample uses puppetlabs-haproxy (for more information visit

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.