File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,12 +19,11 @@ Settings set by router
1919--------------------------
2020The following etcd keys are set by the router component, typically in its /bin/boot script.
2121
22- =========================== =================================================================================
22+ ============================= == =================================================================================
2323setting description
24- =========================== =================================================================================
25- /deis/router/$HOST/host IP address of the host running this router (there can be multiple routers)
26- /deis/router/$HOST/port port used by this router service (there can be multiple routers) (default: 80)
27- =========================== =================================================================================
24+ ============================= ===================================================================================
25+ /deis/router/hosts/$HOST IP address and port of the host running this router (there can be multiple routers)
26+ ============================= ===================================================================================
2827
2928Settings used by router
3029---------------------------
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set -eo pipefail
1313export ETCD_PORT=${ETCD_PORT:- 4001}
1414export ETCD=" $HOST :$ETCD_PORT "
1515export ETCD_PATH=${ETCD_PATH:-/ deis/ router}
16- export HOST_ETCD_PATH=${HOST_ETCD_PATH:-/ deis/ router/ $HOST }
16+ export HOST_ETCD_PATH=${HOST_ETCD_PATH:-/ deis/ router/ hosts / $HOST }
1717export ETCD_TTL=${ETCD_TTL:- 10}
1818
1919# wait for etcd to be available
@@ -85,8 +85,7 @@ if [[ ! -z $EXTERNAL_PORT ]]; then
8585
8686 # while the port is listening, publish to etcd
8787 while [[ ! -z $( netstat -lnt | awk " \$ 6 == \" LISTEN\" && \$ 4 ~ \" .$PORT \" && \$ 1 ~ \" $PROTO .?\" " ) ]] ; do
88- etcdctl --no-sync -C $ETCD set $HOST_ETCD_PATH /host $HOST --ttl $ETCD_TTL > /dev/null
89- etcdctl --no-sync -C $ETCD set $HOST_ETCD_PATH /port $EXTERNAL_PORT --ttl $ETCD_TTL > /dev/null
88+ etcdctl --no-sync -C $ETCD set $HOST_ETCD_PATH " $HOST :$EXTERNAL_PORT " --ttl $ETCD_TTL > /dev/null
9089 sleep $(( $ETCD_TTL / 2 )) # sleep for half the TTL
9190 done
9291
Original file line number Diff line number Diff line change @@ -60,8 +60,9 @@ func TestRouter(t *testing.T) {
6060 time .Sleep (5000 * time .Millisecond )
6161 dockercli .DeisServiceTest (t , name , port , "http" )
6262 etcdutils .VerifyEtcdValue (t , "/deis/router/gzip" , "on" , etcdPort )
63- routerKeyPrefix := "/deis/router/" + host
64- etcdutils .VerifyEtcdValue (t , routerKeyPrefix + "/host" , host , etcdPort )
65- etcdutils .VerifyEtcdValue (t , routerKeyPrefix + "/port" , port , etcdPort )
63+ etcdutils .VerifyEtcdValue (t ,
64+ "/deis/router/hosts/" + host ,
65+ fmt .Sprintf ("%s:%s" , host , port ),
66+ etcdPort )
6667 _ = cli .CmdRm ("-f" , name )
6768}
You can’t perform that action at this time.
0 commit comments