Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

This is a temporary workaround to have etcd listening on all interfaces so you can access it from docker containers.

Add a local etcd unit file

Create a file called /media/state/units/etcd-local.service that has the following contents:

Description=etcd local

ExecStartPre=/bin/systemctl kill etcd.service
ExecStart=/usr/bin/etcd -d /var/lib/etcd -f -cl

# Set a longish timeout in case this machine isn't behaving
# nicely and bothering the rest of the cluster


Enable the local etcd

sudo systemctl restart local-enable.service

curl etcd from inside a container

Setup an ubuntu container with curl

$ docker run -t -i ubuntu /bin/bash
$ apt-get install curl

Now you need to find the ip of the bridge

$ ip route
default via dev eth0 dev eth0  proto kernel  scope link  src

Now just curl from the default route IP:

$ curl

Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.