Load Balance non-web based docker containers

May 2, 2018 209 views
Docker Ubuntu
raghave2
By:
raghave2

Hi,

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

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

Have another answer? Share your knowledge.