Re: Service Discovery on CF for Custom buildpack

Amit Kumar Gupta

Hi Ronak,

I don't totally understand your question. If your other apps can talk to
your micro-gateway app, then they can communicate any data they wish to
that micro-gateway, assuming the micro-gateway has an endpoint to consume
that data. Perhaps you want to look at the documentation on Cloud Foundry
ENV variables (
to see what sort of data an app might have access to that it could in turn
communicate to the gateway.


On Wed, Aug 5, 2015 at 12:00 AM, Ronak Agarwal <roagarwa(a)> wrote:

Hi Amit,

Thanks for your update.

If we build our own micro gateway (a Nodejs app) and push it to CF and
bind all my apps to this micro-gateway. So is there a way - we can
read and update CF app parameters (app url, port,
profile-development/qa/production etc) inside this Nodejs app ??


On Wed, Aug 5, 2015 at 12:05 AM, Amit Gupta <agupta(a)> wrote:
Hi Ronak,

The system etcd and consul should not be used for application service
discovery. There are various approaches to doing service discovery with
applications, but no solution out of the box. The staging process should
generally been seen as an implementation detail of a running
application, it
is typically not an appropriate place for a hook for service
Service discovery and registration should be done at runtime. The
solution involves binding multiple applications to a common service
instance, like a database or message queue. In the future, there may be
etcd or consul service; there may also be some sort of service discovery
built into the CF routing layer at some point.


On Mon, Aug 3, 2015 at 11:57 PM, Ronak Agarwal <roagarwa(a)>


We are trying to introduce a new component that will work together
with our custom buildpack to expose and secure APIs (you can think of
it as a Micro Gateway). In order to configure those gateways a new
webbased UI (our new web component) will be introduced that should
know about all our custom buildpack applications that are pushed to CF
and expose APIs. Ideally speaking every time an app gets pushed to CF
it should also notify the webbased UI that a new API is available
(something like service discovery).

I know CF has Etcd component which is used for Service Discovery but
we use it to push application cluster details to this custom webbased
UI ?

The other part of the question is that the webbased UI will create a
new app that will in turn expose an API as well. That new app will be
exposed to the outside world and route traffic to the pushed
application (our buildpack apps) offcourse after applying some
policies. Would that be possible to do with CF?

Can we setup a proxy for such requirement? which component of CF has
be configured?


Ronak Agarwal
(M) +91 8446044994
(O) +91 20 4150 7935

Join to automatically receive all group messages.