Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update etcd to version 2.0.0 #3960

Merged
merged 1 commit into from
Jan 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cluster/saltbase/salt/etcd/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion cluster/saltbase/salt/etcd/initd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 17 additions & 3 deletions hack/lib/etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$!

kube::util::wait_for_url "http://${host}:${port}/v2/keys/" "etcd: "

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/test" "etcd: "
}

kube::etcd::cleanup() {
Expand Down
2 changes: 1 addition & 1 deletion hack/travis/install-etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down