Sign inSign up

greytip/service-proxy

By greytip

Updated over 10 years ago

service-proxy to front-end various dynamic services

Image
0

667

greytip/service-proxy repository overview

service-proxy

service-proxy acts as a proxy to services that could have changing IP addresses.

While we use consul for service discovery, in many situations (e.g. web monitoring tools) we need a static cluster IP that is fixed and further load balances to various internal service containers.

Kubernetes solves this problem with its external cluster IP feature. However, for Amazon ECS (as of Dec 2015), this is not available.

Running

services.txt Configuration

Before running the container, we need to supply a list of consul services that need to proxied.

The services.txt file has to be in the format:

service-name:port

For example, if the following entry is provided:

zookeeper:2181

The service will be mapped to the domain zookeeper.service.consul:2181

Depending on the services being proxied, the relevant ports need to be opened in the docker run command.

Run command
docker run -d \
   -p 2181:2181 -p 8181:8181 \
   -v /etc/ecs/service-proxy.txt:/services.txt \
   --net=host \
   --name service-proxy greytip/service-proxy

and the service-proxy.txt file looks like this:

zookeeper:2181
exhibitor:8181

Of course, consul should be able to resolve the corresponding services via the DNS interface.

Tag summary

Content type

Image

Digest

Size

54.7 MB

Last updated

over 10 years ago

docker pull greytip/service-proxy:1.6.2