Skip to content

Commit

Permalink
Merge pull request kubernetes#32359 from wojtek-t/rollback_etcd
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue

Use etcd 2.3.7

This will switch to etcd 2.3.7 for release 1.4, to resolve issues rolling back from 1.4 to 1.3 (while preventing those same issues rolling back to 1.4.0 from a release including etcd 3.0.x).

Fixes kubernetes#32253.

See kubernetes#32253 (comment) for etcd roadmap.
  • Loading branch information
Kubernetes Submit Queue authored Sep 9, 2016
2 parents cd30526 + ccb61d8 commit f535aea
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion build/build-image/cross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ RUN mkdir $TMPDIR \
github.com/jteeuwen/go-bindata/go-bindata

# Download and symlink etcd. We need this for our integration tests.
RUN export ETCD_VERSION=v3.0.4; \
RUN export ETCD_VERSION=v2.3.7; \
mkdir -p /usr/local/src/etcd \
&& cd /usr/local/src/etcd \
&& curl -fsSL https://github.com/coreos/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-amd64.tar.gz | tar -xz \
Expand Down
2 changes: 1 addition & 1 deletion build/build-image/cross/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.6.3-4
v1.6.3-5
2 changes: 1 addition & 1 deletion cluster/centos/config-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RELEASES_DIR=${RELEASES_DIR:-/tmp/downloads}
FLANNEL_VERSION=${FLANNEL_VERSION:-"0.5.5"}

# Define etcd version to use.
ETCD_VERSION=${ETCD_VERSION:-"3.0.4"}
ETCD_VERSION=${ETCD_VERSION:-"2.3.7"}

# Define k8s version to use.
K8S_VERSION=${K8S_VERSION:-"1.1.1"}
Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/coreos/kube-manifests/etcd-events.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
--listen-client-urls=http://127.0.0.1:4002
--data-dir=/var/etcd/data-events
1>>/var/log/etcd-events.log 2>&1
image: gcr.io/google_containers/etcd:3.0.4
image: gcr.io/google_containers/etcd:2.3.7
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion cluster/gce/coreos/kube-manifests/etcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
--listen-client-urls=http://127.0.0.1:2379
--data-dir=/var/etcd/data
1>>/var/log/etcd.log 2>&1
image: gcr.io/google_containers/etcd:3.0.4
image: gcr.io/google_containers/etcd:2.3.7
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion cluster/images/hyperkube/static-pods/etcd.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"containers": [
{
"name": "etcd",
"image": "gcr.io/google_containers/etcd-ARCH:3.0.4",
"image": "gcr.io/google_containers/etcd-ARCH:2.3.7",
"command": [
"/usr/local/bin/etcd",
"--listen-client-urls=http://127.0.0.1:2379,http://127.0.0.1:4001",
Expand Down
2 changes: 1 addition & 1 deletion cluster/saltbase/salt/etcd/etcd.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"containers":[
{
"name": "etcd-container",
"image": "gcr.io/google_containers/etcd:{{ pillar.get('etcd_docker_tag', '3.0.4') }}",
"image": "gcr.io/google_containers/etcd:{{ pillar.get('etcd_docker_tag', '2.3.7') }}",
"resources": {
"requests": {
"cpu": {{ cpulimit }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
{
"name": "etcd-container",
"image": "gcr.io/google_containers/etcd:3.0.4",
"image": "gcr.io/google_containers/etcd:2.3.7",
"command": [
"/bin/sh",
"-c",
Expand Down
2 changes: 1 addition & 1 deletion hack/lib/etcd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# A set of helpers for starting/running etcd for tests

ETCD_VERSION=${ETCD_VERSION:-3.0.4}
ETCD_VERSION=${ETCD_VERSION:-2.3.7}
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
ETCD_PORT=${ETCD_PORT:-2379}

Expand Down
25 changes: 14 additions & 11 deletions hack/test-update-storage-objects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,15 @@ killApiServer
# We always perform offline migration, so we need to stop etcd.
#######################################################

kube::etcd::stop
TARGET_STORAGE="etcd3" \
DATA_DIRECTORY="${ETCD_DIR}" \
ETCD=$(which etcd) \
ETCDCTL=$(which etcdctl) \
ATTACHLEASE="${KUBE_OUTPUT_HOSTBIN}/attachlease" \
${KUBE_ROOT}/cluster/images/etcd/migrate-if-needed.sh
kube::etcd::start
# TODO: Uncomment once we support migration.
#kube::etcd::stop
#TARGET_STORAGE="etcd3" \
# DATA_DIRECTORY="${ETCD_DIR}" \
# ETCD=$(which etcd) \
# ETCDCTL=$(which etcdctl) \
# ATTACHLEASE="${KUBE_OUTPUT_HOSTBIN}/attachlease" \
# ${KUBE_ROOT}/cluster/images/etcd/migrate-if-needed.sh
#kube::etcd::start


#######################################################
Expand All @@ -175,7 +176,8 @@ kube::etcd::start

KUBE_API_VERSIONS="${KUBE_NEW_API_VERSION},${KUBE_OLD_API_VERSION}"
RUNTIME_CONFIG="api/all=false,api/${KUBE_OLD_API_VERSION}=true,api/${KUBE_NEW_API_VERSION}=true"
startApiServer ${STORAGE_BACKEND_ETCD3} ${KUBE_NEW_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}
# TODO: Switch to STORAGE_BACKEND_ETCD3 once we support it.
startApiServer ${STORAGE_BACKEND_ETCD2} ${KUBE_NEW_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}

# Update etcd objects, so that will now be stored in the new api version.
kube::log::status "Updating storage versions in etcd"
Expand All @@ -190,7 +192,7 @@ for test in ${tests[@]}; do
new_storage_version=${test_data[5]}

kube::log::status "Verifying ${resource}/${namespace}/${name} has updated storage version ${new_storage_version} in etcd"
ETCDCTL_API=3 ${ETCDCTL} --endpoints="${ETCD_HOST}:${ETCD_PORT}" get "/${ETCD_PREFIX}/${resource}/${namespace}/${name}" | grep ${new_storage_version}
${ETCDCTL} --endpoints="${ETCD_HOST}:${ETCD_PORT}" get "/${ETCD_PREFIX}/${resource}/${namespace}/${name}" | grep ${new_storage_version}
done

killApiServer
Expand All @@ -206,7 +208,8 @@ RUNTIME_CONFIG="api/all=false,api/${KUBE_NEW_API_VERSION}=true"

# This seems to reduce flakiness.
sleep 1
startApiServer ${STORAGE_BACKEND_ETCD3} ${KUBE_NEW_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_PROTOBUF}
# TODO: Switch to STORAGE_BACKEND_ETCD3 once we support it.
startApiServer ${STORAGE_BACKEND_ETCD2} ${KUBE_NEW_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_PROTOBUF}

for test in ${tests[@]}; do
IFS=',' read -ra test_data <<<"$test"
Expand Down
4 changes: 2 additions & 2 deletions test/kubemark/start-kubemark-master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ "${EVENT_STORE_IP}" == "127.0.0.1" ]; then
# Retry starting etcd to avoid pulling image errors.
retry sudo docker run --net=host \
-v /var/etcd/data-events:/var/etcd/data -v /var/log:/var/log -d \
gcr.io/google_containers/etcd:3.0.4 /bin/sh -c "/usr/local/bin/etcd \
gcr.io/google_containers/etcd:2.3.7 /bin/sh -c "/usr/local/bin/etcd \
--listen-peer-urls http://127.0.0.1:2381 \
--advertise-client-urls=http://127.0.0.1:4002 \
--listen-client-urls=http://0.0.0.0:4002 \
Expand All @@ -41,7 +41,7 @@ fi
# Retry starting etcd to avoid pulling image errors.
retry sudo docker run --net=host \
-v /var/etcd/data:/var/etcd/data -v /var/log:/var/log -d \
gcr.io/google_containers/etcd:3.0.4 /bin/sh -c "/usr/local/bin/etcd \
gcr.io/google_containers/etcd:2.3.7 /bin/sh -c "/usr/local/bin/etcd \
--listen-peer-urls http://127.0.0.1:2380 \
--advertise-client-urls=http://127.0.0.1:2379 \
--listen-client-urls=http://0.0.0.0:2379 \
Expand Down

0 comments on commit f535aea

Please sign in to comment.