load-balancingcloud-foundrypivotal-web-services

PCF - Pivotal App manager - Routing same URL to different version of same application.


We have two versions of application deployed to PCF. Can we have same "Route / URL" for both the versions of application and define %of traffic each have to handle?

example.com/myapp -> Applicatoin instance 1 -> **Handle 90% of request**

example.com/myapp -> Applicatoin instance 2 -> **Handle 10% of request**    

We need this in Pilot kind of scenario to avoid one big bang deployment and any potential downtime.

Have checked out how routing works in PCF here. Could find solution for what we want.

https://docs.cloudfoundry.org/devguide/deploy-apps/routes-domains.html#map-route


Solution

  • The simplest way to do this (avoid implementing your own load-balancing) is as follows:

    1) Start 9 instances of Application 1 for every instance of Application 2

    2) Map the same route to both applications (you can do this with cf map-route or use the Apps Manager Web UI)

    Now 10% of requests will be serviced by Application 2. As you observe system behavior, you can adjust instance counts until you have completed the transition to Application 2, or rolled back to Application 1.