Load Balance non-web based docker containers

Posted May 2, 2018 1.8k views


I am trying a usecase where I am doing the following:

  1. Create a containers for the service exposed on ports 2321,2322 , the service is not an http service and has no endpoint API - Done
  2. Scale the service to multiple containers- 5- Done
  3. Load Balance the incoming requests to the service , the incoming request are via shell commands which the service accepts and responds. - Not able to achive

How can i load balance incoming requests to a non-http service running inside a container. I tried HAPROXY, but it accepts http protocol on port 80 by default.

Kindly suggest

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

The DO Load Balancer service will support any TCP protocol out of the box. You would just need to configure it with the correct ports.

This guide will help you with configuring HAProxy to load balance your nodes. You’ll need to ensure that the mode is changed from http to tcp