Public Repository

Last pushed: 3 years ago
Short Description
etcd and marathon based service discovery
Full Description

I'll document more in a while, but until then:

This will setup an haproxy in front of your services. This haproxy automatically configures itself, based on a template (using apache velocity), and a data source (currently etcd and/or marathon).

I built this because I'm using both Marathon and etcd to run services, and because apache velocity provides a much more robust / readable templating format compared to golang's.

I'll share the source code in due time.

run this image without arguments for a full list of command line options.

example:

docker run \
    --name=${CONTAINER_NAME} \
    --rm \
    -p 8080:8080 \
    -p 4443:4443 \
    -p 1000:1000 \
    -v ${ARTIFACT_DIR}/certificates/:/opt/multicloud/discovery/pem/ \
    -v /dev/log:/dev/log \
    yaronr/discovery -etcdUrl http://$bridge_ip:4001 -marathonUrl http://marathon:8080 -templateFileUrl https://gist.githubusercontent.com/yaronr/c3d527145a3b0f2459ee/raw/haproxy.cfg.template'

For Marathon services to be 'discovered' by this service, you need to supply additional environment variables as part of the Marathon application. For example:

"env": {
    "DISCOVERY_DOMAIN": "test.multicloud.me",
"DISCOVERY_FRONTEND": "http"
  }

Take a look at the following templat to understand how this works, and create your own version: https://gist.githubusercontent.com/yaronr/c3d527145a3b0f2459ee/raw/haproxy.cfg.template

Docker Pull Command
Owner
yaronr