Hi Swapnil, Thanks for your response on this. IMO we could achieve this functionality without having to use a haproxy instance.
The concept we have here is to group all the members of a cluster and use a hostname to load balance incoming requests among them. With GCE what we can do is to create a target pool for each cluster and either have a dedicated external IP address for each target pool or use different ports on the same external IP address to access them. As an additional step we could map the external IP address to a hostname by using a DNS entry or by using /etc/hosts. Thanks On Mon, Apr 20, 2015 at 9:57 PM, Swapnil Patil <swapnil.r...@gmail.com> wrote: > Hi, > > I have proposed a solution for the project on $subject where I am using an > HA Proxy between incoming request and Google Compute Engine (GCE) load > balancing components. > > I have been advised to provide more description regarding why I am using > HA Proxy in my proposed solution. > > Please find below the reason for the same. > > Stratos needs to route traffic based on the hostname field of the incoming > request. I have proposed to use Network Load Balancing of Google Compute > Engine (GCE) which does not provide any central component that makes > routing decisions based on the hostname field of the request. > > GCE network load balancing has following concepts > 1. Target pool - a set of instances. In Stratos, a cluster can be treated > as target pool. > 2. Forwarding rule - A forwarding rule has an external IP, a port range, a > target pool. Whenever a request is made to this external IP with port > numbers specified in the port range, the request is routed to the specified > target pool. > > As GCE network load balancing does not have any mechanism to route traffic > based on hostname, I proposed to use HA Proxy between incoming requests and > GCE load balancing components. > > If we use HA Proxy, we can add a rule saying which forwarding rule should > be used for a particular combination of hostname, protocol and port. So > forwarding rules of GCE load balancing will act as backend instances of HA > Proxy. > > So overall flow would be as follows > 1. HA Proxy decides which backend (forwarding rule) to use based on the > incoming request. > 2. Request is delegated to the GCE forwarding rule associated with that > backend. > 3. Forwarding rule of GCE routes the incoming request to the target pool > which is specified in the rule. > 4. Target pool routes the incoming request to a particular instance in the > pool i.e. an instance in the cluster. > > This is what I thought would be an appropriate solution. I would > appreciate if anybody has any thoughts on this. > > Thanks and Regards, > Swapnil Patil > IIIT Hyderabad > -- Imesh Gunaratne Technical Lead, WSO2 Committer & PMC Member, Apache Stratos