We have been attempting to put a load balancer in front of our etcd cluster so that clients that need to talk to it can just hit that URL. As part of that, we cut off direct access to the etc nodes on 2379 -- they only accept that from the load balancer. Traffic between nodes within the cluster is still all open, but clients can only connect to a node through the load balancer.
This seems to be working fine for clients that are just using curl to make a request. However, when using something that uses the Go etcd client, such as confd, we're getting errors:
2015-09-09T20:28:16Z 17458f07b087 confd[8]: INFO Backend set to etcd
2015-09-09T20:28:16Z 17458f07b087 confd[8]: INFO Starting confd
2015-09-09T20:28:16Z 17458f07b087 confd[8]: INFO Backend nodes set to http://<domain-name-of-etcd-load-balancer>
2015-09-09T20:28:31Z 17458f07b087 confd[8]: ERROR 501: All the given peers are not reachable (Tried to connect to each peer twice and failed) [0]
It looks like it may be asking http://
<domain-name-of-etcd-load-balancer>/v2/members for the list of members and then trying to connect directly to one of them, rather than just issue the actual requests directly against http://
<domain-name-of-etcd-load-balancer>. The issue goes away if I reopen direct access to the individual nodes from clients, but that's not the model I would prefer to use.
Does etcd support such a configuration? Do I just need to set the advertise-client-urls parameter to <domain-name-of-etcd-load-balancer>? Or if I set all cluster nodes to the same value here, rather than urls that are specific to each node, will that cause other problems?
If a load balancer configuration isn't recommended, what is the right way to present clients a single view of the cluster? Just round-robin DNS to all nodes, and allow direct traffic to each node?