News for hackers. Stuff that matters.
Re:Getting Started with Docker by vidarh on Friday March 21, 2014 @10:31AM (#7442499)
Update etcd with connection details on container start/stop. Then use a script to watch the appropriate directory in etcd for changes and regenerate the config.

Look at "fleet" from CoreOS, and especially their "sidekick" example that uses systemd dependencies to trigger etcd updates: https://coreos.com/docs/launching-containers/launching/launc... though you can certainly do this without fleet too.

Then on the haproxy/varnish box (or put them in a container), put something that does "etcdctl exec-watch /services/website -- updateconfig.sh", where updateconfig.sh would be a script to watch for changes and regenerate the config / reload.

I don't see how your config will get "bloated" any more than it would otherwise - presumably your number of domains won't increase.

Re:Getting Started with Docker by derefr on Friday March 21, 2014 @04:21PM (#7444663)
This is what DNS is for. If you specify your backends by hostname instead of IP, then each time the load-balancer tries to connect to the backend, it'll get a list of A records from its DNS resolver and pick one in a round-robin fashion. Thus, if you have a dynamic DNS server that queries your presence service, it can return exactly the hosts that are up right now as the round-robin set.

Right now, if you use SkyDNS[1] as your DNS server, and attach Skydock to the Docker host, this all Just Works. Most people want to use etcd instead of Skydock, though, so support for that is coming soon[1] too.

[1] https://github.com/skynetservices/skydns

[2] https://groups.google.com/forum/#!topic/coreos-dev/iklEYHh5J...

Re:Getting Started with Docker by otterley on Friday March 21, 2014 @07:36PM (#7445694)
SkyDNS looks interesting, but it doesn't appear to do any heath checks on the endpoint. I don't want clients to receive an answer to an A record query that contains the IP address of an endpoint that is down.

Am I mistaken?

Re:Getting Started with Docker by nl on Saturday March 22, 2014 @05:55AM (#7448463)
You probably don't want a healthcheck done for every DNS request.

Better to have a healthcheck service doing healthchecking, and modify SkyDNS along with whatever else happens when a service goes down.

Re:Getting Started with Docker by otterley on Saturday March 22, 2014 @05:35PM (#7451012)
In order to be robust in the event of a network partition, the client should perform the the health check itself. This can be done in a background thread; it doesn't have to be synchronous with the DNS lookup (and that would be very bad for performance anyway).
Re:Getting Started with Docker by mateuszf on Saturday March 22, 2014 @02:55AM (#7448090)
Doesn't it mean that every tcp connection would have to query dns at the beginning? What about client dns cache? Also, isn't that expensive in terms of connection time?