How to load-balance among two docker services?

Viewed 243
  • I Have docker-service (Node.js)
    • I am calling this service through API-gateway (spring-boot) using zuul routes.
    • I run the service on 2 different port and name of that 2 microservice is also different.
    • The internal name of the service is same and using the same name it enrolls on Eureka.

enter image description here

enter image description here

  • I want to perform a Load balance on this service so that few request can serve by 1st service and few by 2nd.

I am running this service using below command

sudo docker run -p ${EXTERNAL_PORT_NUMBER}:${INTERNAL_PORT_NUMBER} --network ${NETWORK} --name ${SERVICE_NAME} -m 1024M --memory-swap -1 -itd ${ORGANISATION}/${SERVICE_NAME}:${VERSION}

Is there something that I can configure for load-balance in command itself or any alternative ??

1 Answers
Related