Documentation: add documentation for single node docker etcd
Fixes
@@ -68,6 +68,35 @@ Production clusters which refer to peers by DNS name known to the local resolver
In order to expose the etcd API to clients outside of Docker host, use the host IP address of the container. Please see [`docker inspect`](https://docs.docker.com/engine/reference/commandline/inspect) for more detail on how to get the IP address. Alternatively, specify `--net=host` flag to `docker run` command to skip placing the container inside of a separate network stack.
+### Running a single node etcd
+
+Use the host IP address when configuring etcd:
+
+```
+export NODE1=192.168.1.21
+```
+
+Run the latest version of etcd:
+
+```
+docker run --net=host \
+ --volume=${DATA_DIR}:/etcd-data \
+ --name etcd quay.io/coreos/etcd:latest \
+ /usr/local/bin/etcd \
+ --data-dir=/etcd-data --name node1 \
+ --initial-advertise-peer-urls http://${NODE1}:2380 --listen-peer-urls http://${NODE1}:2380 \
+ --advertise-client-urls http://${NODE1}:2379 --listen-client-urls http://${NODE1}:2379 \
+ --initial-cluster node1=http://${NODE1}:2380
+```
+
+List the cluster member:
+
+```
+etcdctl --endpoints=http://${NODE1}:2379 member list
+```
+
+### Running a 3 node etcd cluster
+
```
# For each machine
ETCD_VERSION=latest
@@ -85,7 +114,7 @@ DATA_DIR=/var/lib/etcd
# For node 1
THIS_NAME=${NAME_1}
THIS_IP=${HOST_1}
-sudo docker run --net=host \
+docker run --net=host \
--volume=${DATA_DIR}:/etcd-data \
--name etcd quay.io/coreos/etcd:${ETCD_VERSION} \
/usr/local/bin/etcd \
@@ -98,7 +127,7 @@ sudo docker run --net=host \
# For node 2
THIS_NAME=${NAME_2}
THIS_IP=${HOST_2}
-sudo docker run --net=host \
+docker run --net=host \
--volume=${DATA_DIR}:/etcd-data \
--name etcd quay.io/coreos/etcd:${ETCD_VERSION} \
/usr/local/bin/etcd \
@@ -111,7 +140,7 @@ sudo docker run --net=host \
# For node 3
THIS_NAME=${NAME_3}
THIS_IP=${HOST_3}
-sudo docker run --net=host \
+docker run --net=host \
--volume=${DATA_DIR}:/etcd-data \
--name etcd quay.io/coreos/etcd:${ETCD_VERSION} \
/usr/local/bin/etcd \
