From c1c547ce313096247a45d11e6baee71a7321ec4e Mon Sep 17 00:00:00 2001 From: Sukrit Khera Date: Wed, 17 Jan 2018 13:52:13 -0700 Subject: [PATCH] Add Etcd Cluster Health for Yoda Proxy Add Etcd Cluster Health for Yoda Proxy. This will prevent yoda proxy from starting if etcd is unhealthy. --- bin/supervisord-wrapper.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/supervisord-wrapper.sh b/bin/supervisord-wrapper.sh index 451aa22..4800b9f 100755 --- a/bin/supervisord-wrapper.sh +++ b/bin/supervisord-wrapper.sh @@ -5,6 +5,7 @@ HOST_IP="${HOST_IP:-127.0.0.1}" cat <> /etc/profile.d/cluster-deployer-env.sh export HOST_IP='${HOST_IP}' export ETCD_URL='${ETCD_URL:-${HOST_IP}:4001}' +export ETCDCTL="${ETCDCTL:-etcdctl --peers $ETCD_URL}" export ETCD_PROXY_BASE='${ETCD_PROXY_BASE:-/yoda}' export PROXY_HOST='${PROXY_HOST:-yoda.local.sh}' export SYNC_CERTS='${SYNC_CERTS:-false}' @@ -18,5 +19,6 @@ if [ ! -e /dev/log ]; then service rsyslog start fi +$ETCDCTL cluster-health -/bin/bash -le -c "/usr/local/bin/supervisord -c /etc/supervisor/supervisord.conf" \ No newline at end of file +/bin/bash -le -c "/usr/local/bin/supervisord -c /etc/supervisor/supervisord.conf"