The 12-factor app suggests to use port-binding so that the app is completely self-contained. We can use embedded tomcat or jetty to achieve this but I was wondering what how scaling out is handled in this scenario.
Setup
Currently I have services exposed using embedded tomcat. I can use Apache HTTP server for load-balancing.
Question
How to dynamically add new services to scale-out in this scenario? I ask because adding new service means that I also need to add it as part of the EXISTING cluster.
It depends on what you put in front of the app, in the past I've used nginx and HA Proxy, and the config files for those services need to be adjusted to be aware of the additional instances you're now running. Hopefully that's automated as part of the same process that created those new instances.