0
votes

In cloud foundry all apps are accessible via cloud foundry load balancers. Each load balancer has an url under which to call the app. Even though there is a hidden way (e.g. X-CF-APP-INSTANCE), it is not meant to call an app instance directly.

Eureka is highly available and partition tolerant, but it lacks of consistency (CAP theorem). To overcome the staleness of registry data, Netflix uses client side load balancing (Ribbon). (see: https://github.com/Netflix/eureka/wiki/Eureka-2.0-Architecture-Overview)

Because an app in cloud foundry is called via its load balancer, it registers itself with the address of the load balancer at Eureka. As stated before, the app instance does not even have an address. To make it more visible, let's say there are two instances of an app A (a1 and a2) that register themself at Eureka. Eureka now has two entries for the app A but both having the same address assigned.

Now when Ribbon takes place to overcome the consistency problem of Eureka, it is very likely that a retry is directed to the same instance as the first try. Failover using Ribbon is therefore not working with Eureka in cloud foundry.

The fact that all instances of an app are assigned to the same address in Eureka, makes things complicated in many situations. Even the replication of Eureka we could solve with a workaround only. Turbine needs to be fed in push mode etc.

We are thinking about enhancing Eureka so that it sets the X-CF-APP-INSTANCE header. Now before doing that, we wanted to know whether someone knows an easier way to make Eureka really work on cloud foundry?

This question is realated to: Deploying Eureka/ribbon code to Cloud Foundry

1

1 Answers

0
votes

I think Eureka, and any other discovery service, has no place in a PaaS like CloudFoundry. Although it sounds appealing to enhance Eureka to support the X-CF-APP-INSTANCE header, you would also need to enhance the client part (Ribbon) to take advantage of that information, and add that header to each request.

Well, it's 9 months later, maybe you have done that in the meantime? Or you follow an alternative solution path?

Anyway, there's an additional app to app integration option in the meantime, the container to container networking. And even here, the CloudFoundry dev team decided to provide their own discovery mechanism.