etcd-v3/confd docker image
Quick Guide (Docker)
$ docker run --rm -it -p 2379:2379 -p 2380:2380 --name etcd chai2010/etcd
$ curl 127.0.0.1:2379/version
$ curl 127.0.0.1:2379/v2/keys
$ curl http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world"
$ curl 127.0.0.1:2379/v2/keys
$ curl http://127.0.0.1:2379/v2/keys/message
Quick Guide (Cluster/Docker Compose)
# start 3 node, port on :2379/:3379/:4379
$ docker-compose up -d
$ curl 127.0.0.1:2379/version
$ curl 127.0.0.1:2379/v2/keys
$ curl http://127.0.0.1:2379/v2/keys/message -XPUT -d value="Hello world"
$ curl 127.0.0.1:2379/v2/keys
$ curl http://127.0.0.1:2379/v2/keys/message
# get from other etcd node
$ curl 127.0.0.1:3379/v2/keys
Quick Guide (confd/etcd)
# start etcd, 3 nodes
$ docker-compose up -d
# start confd on macOS
# windows: make confd-win
# linux: make confd-linux
$ make confd-macos
# view generated ./conf-data/etc/myapp/myapp.json
# change config value in etcd
$ curl http://127.0.0.1:2379/v2/keys/myapp/database/user -XPUT -d value="new value"
# view generated ./conf-data/etc/myapp/myapp.json
Connect to host from docker container
- Linux: 172.17.0.1
- macOS: docker.for.mac.localhost
- Windows: docker.for.win.localhost
- Vagrant: 10.0.2.2
Run Test
make debug
make test
make clean
License
The Apache License.