0

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

Anand
  • 9,672
  • 4
  • 55
  • 75

1 Answers1

2

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.

Corby Page
  • 1,385
  • 10
  • 17
  • That's a way of achieving what we want for sure. Thanks for the solution. Do we have any other way to manipulate the inbuilt load balancer to achieve the % load balance (Like we can do with HAProxy) ? Especially when we have less number of instance. Say 3 Old and one new and we have to route 5-10% to new code. – Anand May 23 '17 at 13:51
  • For sure, we don't want to implement our own load balancer!! – Anand May 23 '17 at 13:52
  • 2
    No, the PCF Router uses a basic round-robin approach to load balancing between application instances, and this algorithm can not be directly modified. – Corby Page May 23 '17 at 17:42
  • Thanks for the clarification. – Anand May 23 '17 at 19:34