Sign inSign up

tleyden5iwx/etcd-discovery

By tleyden5iwx

Updated over 10 years ago

Image
0

50K+

tleyden5iwx/etcd-discovery repository overview

A wrapper around etcd, with some discovery-related additions that calls etcd with the right advertising related URLs.

The problem this is trying to solve

As described in this Google Groups thread, when running etcd in the context of Kubernetes, there's no straighforward way to discover what IP should be used for the -advertise-client-urls etcd parameter.

Without a correct -advertise-client-urls etcd parameter, code that uses the etcd client API (such as etcdctl) will not work. (curl, on the other hand, will still work)

How to use

Instead of invoking etcd via:

$ etcd -listen-client-urls http://0.0.0.0:2379 -advertise-client-urls http://10.1.50.34:2379

You would instead run:

$ etcdisco -listen-client-urls http://0.0.0.0:2379 -advertise-client-urls http://{{.LOCAL_IP}}:2379

This would have the effect of:

  • etcdisco would attempt to discover the ip it should be advertising
  • it will look over the command line args and replace {{.LOCAL_IP}} with the discovered ip address
  • it will invoke etcd with the modified command line args

Supported variables

VariableDescription
LOCAL_IPIt iterates over all interfaces and returns the IP address of the first non-loopback IP address

Tag summary

Content type

Image

Digest

sha256:87764ac96

Size

11.1 MB

Last updated

over 10 years ago

docker pull tleyden5iwx/etcd-discovery