Load balancer setup and configuration design

Using a containerized software load balancer is a great way to manage and upgrade a software firewall. There are several great load balancer options, including NGINX and HAProxy. For our example, we are using HAProxy. 

In order to make sense of the HAProxy configuration, we will first need to understand how the host adapter ports are bound to the container where the HAProxy software is running. The following is a sample script used to start the HAProxy load balancer. Carefully note the port mappings (-p host-adapter:host-port:container-port) when the Docker container for HAProxy is launched. Ports 80, 443, 4443, 6443, and 8443 are mapped inside the container, as follows:

  • Port 80 is for inbound ...

Get Mastering Docker Enterprise 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.