Skip to content

Commit

Permalink
Merge pull request #27 from adidenko/etcd-endpoints-support
Browse files Browse the repository at this point in the history
Add support for ETCD_ENDPOINTS
  • Loading branch information
robbrockbank authored Mar 1, 2017
2 parents 7f99c90 + da4e7ff commit 7a5cf42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 3 additions & 4 deletions build_routereflector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Run the following command to start the Route Reflector container image.
docker run -privileged -net=host -d \
-e IP=<IPv4_RR> \
[-e IP6=<IPv6_RR>] \
-e ETCD_AUTHORITY=<ETCD_IP:PORT> \
-e ETCD_ENDPOINTS=<http://ETCD_IP:PORT> \
calico/routereflector
```

Expand Down Expand Up @@ -101,9 +101,8 @@ certificate files and environment variable filepaths for each file:
docker run -privileged -net=host -d \
-e IP=<IPv4_RR> \
[-e IP6=<IPv6_RR>] \
-e ETCD_AUTHORITY=<ETCD_IP:PORT> \
-e ETCD_ENDPOINTS=<https://ETCD_IP:PORT> \
-v <FULL_PATH_TO_CERT_DIR>:<MOUNT_DIR> \
-e ETCD_SCHEME=https \
-e ETCD_CA_CERT_FILE=<MOUNT_DIR>/<CA_FILE> \
-e ETCD_CERT_FILE=<MOUNT_DIR>/<CERT_FILE> \
-e ETCD_KEY_FILE=<MOUNT_DIR>/<KEY_FILE> \
Expand Down Expand Up @@ -143,7 +142,7 @@ From any Calico Docker node, run the following:

calicoctl bgp node-mesh off

You may need to set the ETCD_AUTHORITY environment variable to run the
You may need to set the ETCD_ENDPOINTS environment variable to run the
calicoctl commands.


Expand Down
10 changes: 8 additions & 2 deletions build_routereflector/node_filesystem/etc/service/confd/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/sh

# Use ETCD_ENDPOINTS in preferences to ETCD_AUTHORITY
ETCD_NODE=${ETCD_ENDPOINTS:=${ETCD_SCHEME:=http}://${ETCD_AUTHORITY}}

# confd needs a "-node" arguments for each etcd endpoint.
ETCD_ENDPOINTS_CONFD=`echo "-node=$ETCD_NODE" | sed -e 's/,/ -node=/g'`

exec 2>&1
exec /confd -confdir=/ -interval=5 -watch --log-level=debug \
-node=${ETCD_SCHEME:=http}://${ETCD_AUTHORITY} \
-client-key=${ETCD_KEY_FILE} -client-cert=${ETCD_CERT_FILE} \
-client-ca-keys=${ETCD_CA_CERT_FILE} -scheme=${ETCD_SCHEME:=http}
-client-ca-keys=${ETCD_CA_CERT_FILE} $ETCD_ENDPOINTS_CONFD

0 comments on commit 7a5cf42

Please sign in to comment.