Merge pull request #3960 from brendandburns/shell_sucks

Update etcd to version 2.0.0
pull/6/head
Satnam Singh 2015-01-29 18:46:18 -08:00
commit e619f303d7
4 changed files with 22 additions and 6 deletions

View File

@ -10,10 +10,10 @@
# shasum <tar>
# 6. Update this file with new tar version and new hash
{% set etcd_version="v0.4.6" %}
{% set etcd_version="v2.0.0" %}
{% set etcd_tar_url="https://storage.googleapis.com/kubernetes-release/etcd/etcd-%s-linux-amd64.tar.gz"
| format(etcd_version) %}
{% set etcd_tar_hash="sha1=5db514e30b9f340eda00671230d5136855ae14d7" %}
{% set etcd_tar_hash="sha1=b3cd41d1748bf882a58a98c9585fd5849b943811" %}
etcd-tar:
archive:

View File

@ -16,7 +16,9 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="The etcd key-value share configuration service"
NAME=etcd
DAEMON=/usr/local/bin/$NAME
DAEMON_ARGS="-peer-addr $HOSTNAME:7001 -name $HOSTNAME"
# DAEMON_ARGS="-peer-addr $HOSTNAME:7001 -name $HOSTNAME"
host_ip=$(hostname -i)
DAEMON_ARGS="-addr ${host_ip}:4001 -bind-addr ${host_ip}:4001 -data-dir /var/etcd -initial-advertise-peer-urls http://${HOSTNAME}:2380 -name ${HOSTNAME} -initial-cluster ${HOSTNAME}=http://${HOSTNAME}:2380"
DAEMON_LOG_FILE=/var/log/$NAME.log
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

View File

@ -30,12 +30,26 @@ kube::etcd::start() {
exit 1
fi
version=$(etcd -version | cut -d " " -f 3)
if [[ "${version}" < "2.0.0" ]]; then
kube::log::usage "etcd version 2.0.0 or greater required."
exit 1
fi
# Start etcd
ETCD_DIR=$(mktemp -d -t test-etcd.XXXXXX)
etcd -name test -data-dir ${ETCD_DIR} -addr ${host}:${port} >/dev/null 2>/dev/null &
kube::log::usage "etcd -data-dir ${ETCD_DIR} -addr ${host}:${port} >/dev/null 2>/dev/null"
etcd -data-dir ${ETCD_DIR} -addr ${host}:${port} >/dev/null 2>/dev/null &
ETCD_PID=$!
echo "Waiting for etcd to come up."
while true; do
if curl -L http://127.0.0.1:4001/v2/keys/test -XPUT -d value="test"; then
break
fi
done
kube::util::wait_for_url "http://${host}:${port}/v2/keys/" "etcd: "
kube::util::wait_for_url "http://${host}:${port}/v2/keys/test" "etcd: "
}
kube::etcd::cleanup() {

View File

@ -20,7 +20,7 @@ set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
ETCD_VERSION=${ETCD_VERSION:-v0.4.6}
ETCD_VERSION=${ETCD_VERSION:-v2.0.0}
cd "${KUBE_ROOT}/third_party"
curl -sL https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz \