bellycard / docker-loadbalancer

121 stars 29 forks source link

Provision consul, registrator, LB and backend fia Fig #2

Closed shanesveller closed 10 years ago

shanesveller commented 10 years ago

@bellycard/infrastructure

Playground: fig scale app=3 and refresh your browser a few times to watch the backend container ID change.

kevinreedy commented 10 years ago

Looking sweet so far

shanesveller commented 10 years ago

@kevinreedy When you're not busy and have good Internet, can you play with the instructions and see what I've missed?

kevinreedy commented 10 years ago

Playing with it now

kevinreedy commented 10 years ago

I got it working, but here were the gotchas:

kreedy@Kevins-MacBook-Pro-2:~/Projects/docker-loadbalancer/nginx-official$ curl http://`boot2docker ip`:8500/v1/catalog/services

The VM's Host only interface IP address is:

{"app":["production"],"consul":[],"consul-53":["udp"],"consul-8300":[],"consul-8400":[],"consul-8500":[],"nginxofficial_lb-80":[]}

As for the TODO section, will we need Vagrant anymore once we have fig?

shanesveller commented 10 years ago

It looks like if I redirect stderr I can clean up the output, although the command itself becomes even more ugly:

$ curl http://`boot2docker ip 2>/dev/null`:8500/v1/catalog/services
{"app":["production"],"consul":[],"consul-53":["udp"],"consul-8300":[],"consul-8400":[],"consul-8500":[],"web_lb":[]}

I still get some kind of odd variant of a % symbol at the end in my particular shell environment.

For Vagrant, my thought process there is to try to make this also work in a CoreOS VM to get closer to our present production environment.

kevinreedy commented 10 years ago

Yea, that is pretty ugly. In the one-liner we could do something like export $OMG_IP=boot2docker ip. Not sure it's worth the trouble though.

kevinreedy commented 10 years ago

As for Vagrant, I don't think it matters too much in this example. When it comes to dif for napa services we may want to drop Vagrant for simplicity's sake. We can cross that bridge when we get there.

shanesveller commented 10 years ago

@bellycard/infrastructure Ready for final review. Particular attention towards open-sourcing this as-is appreciated!

shanesveller commented 10 years ago

If we're going to OS this repo as-is, thoughts on moving pretty much everything into the root?

kevinreedy commented 10 years ago

:+1: moving to root sounds like a good plan