dockercloud-haproxy icon indicating copy to clipboard operation
dockercloud-haproxy copied to clipboard

Added "Services" env var for explicit declaration

Open Jascen opened this issue 7 years ago • 0 comments

Note: I don't really know Python. I hacked my way around, so I apologize if anything just looks plain dumb.

  • You can now indicate your Service(s) to be load balanced ("SERVICES" Environment Variable on HAProxy)
  • Note: Services env var only only apply to services within the same project/namespace.
  • Format is: "ServiceName:Port,Port;ServiceName"...
    • Ex: SERVICES=nginxapp1:443,8080;nginxapp2:80,nginxapp3
  • If any services are specified, HAProxy will only pay attention to the defined services in this variable. 
    • Compose: must Link the service to the HAProxy
  • If any ports are specified, they will be the only ports used for that service.  
    • Note: If no ports are specified:
      • Swarm: it will check the Service for the Env Var "SERVICE_PORTS" (original behavior)
      • Compose: it will add all exposed ports (original behavior)
  • If a specified service is not on the same network as HAProxy, it will be ignored (original behavior)

Jascen avatar Oct 20 '17 17:10 Jascen