The sidecar-buildpack
is a Cloud Foundry buildpack that allows any
application to use Netflix OSS Eureka and Zuul
for service discovery and proxying respectively - regardless of whether or not it is a Spring Boot, Spring, or even a Java application.
-
Start with an existing
Cloud Foundry
application -
add a
.sidecar_buildpacks
file to the root of the application containing a link to your application’s current buildpack (git repo or .tgz) e.g. https://github.com/cloudfoundry/nodejs-buildpack.git -
(Optional) implement a '/health' endpoint that returns the following:
-
the
content-type
header:Content-Type: application/json
-
body:
{"status": "UP"}
-
Eureka will show your app as 'Down' unless you properly implement the
/health
endpoint
-
-
if your application uses the Command Attribute in its
manifest.yml
, move the command into a Procfile -
Deploy with:
$ cf push -b https://github.com/rhardt-pivotal/sidecar-buildpack
The following make up a suite of apps that will register with a eureka instance via a sidecar and can then reference
one another. They each expose the self-explanatory endpoints /javafortune
(a Spring Boot Fortune Teller service), /rubyfortune
, /nodefortune
, /pythonfortune
,
and /gofortune
.
The actual sidecar functionality resides in a Spring Boot jar in the Resources directory. The repo for that jar is here
This buildpack is built almost entirely of components from the Cloud Foundry Java Buildpack and the Heroku Multi Buildpack
This buildpack is released under version 2.0 of the Apache License.