Docker Clustering multiple proxies fronting multiple tomcats

6/18/2016

ls,

I want to move a cluster of application servers fronted by proxies to a Kubernetes Docker environment. We now have a failover crossed clustering like cluster and we are using sticky sessions to limit resources needed for our memory prone solution (>2GB each Tomcat).

I am now struggling with the concept of each component as microservice. Both microservices (Proxy/Tomcat) should scale independently as needed. Also considering self healing of a service with a minimum of 2 containers. Each container should be agnostic eg: unaware of its surroundings, it provides a service to another component.

Now how would a proxy container binds itself to all underlying tomcat containers? How could a proxy container binds whit a tomcat container added/resurrected later than this proxy container started? Now how would a proxy container maintain stickyness to a specific tomcat container?

I purposely tried to keep question and description as minimal as possible, happy to give more details of course.

Regards, Corné

BTW sorry for the cross post i was in the assumption i posted to stack overflow in the first place https://superuser.com/questions/1090867

-- Corné
cluster-computing
docker
kubernetes
proxy
tomcat

1 Answer

7/1/2016

I found my own solution in this blog post

The solution is to directly load balance to the pods without load balancing the traffic to the service. This functionality is implemeted with service-loadbalancer in kubernetes. This implementation uses haproxy to enable session affinity and directly load balance the external traffic to the pods without going through services. 

http://nishadikirielle.blogspot.nl/2016/03/load-balancing-kubernetes-services-and.html

-- Corné
Source: StackOverflow