Merge pull request #84329 from jingyih/update_etcd_server_to_3.4

Update default etcd server to 3.4.3
This commit is contained in:
Kubernetes Prow Robot
2019-10-30 02:30:52 -07:00
committed by GitHub
16 changed files with 40 additions and 33 deletions

View File

@@ -14,13 +14,13 @@
.PHONY: build push
ETCD_VERSION = 3.3.17
ETCD_VERSION = 3.4.3
# Image should be pulled from k8s.gcr.io, which will auto-detect
# region (us, eu, asia, ...) and pull from the closest.
REGISTRY = k8s.gcr.io
# Images should be pushed to staging-k8s.gcr.io.
PUSH_REGISTRY = staging-k8s.gcr.io
TAG = 3.3.17.0
TAG = 3.4.3.0
clean:
rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz

View File

@@ -15,7 +15,7 @@
# Build the etcd image
#
# Usage:
# [BUNDLED_ETCD_VERSIONS=3.0.17 3.1.12 3.2.24 3.3.17] [REGISTRY=k8s.gcr.io] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
# [BUNDLED_ETCD_VERSIONS=3.0.17 3.1.12 3.2.24 3.3.17 3.4.3] [REGISTRY=k8s.gcr.io] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
#
# The image contains different etcd versions to simplify
# upgrades. Thus be careful when removing any versions from here.
@@ -26,10 +26,10 @@
# Except from etcd-$(version) and etcdctl-$(version) binaries, we also
# need etcd and etcdctl binaries for backward compatibility reasons.
# That binary will be set to the last version from $(BUNDLED_ETCD_VERSIONS).
BUNDLED_ETCD_VERSIONS?=3.0.17 3.1.12 3.2.24 3.3.17
BUNDLED_ETCD_VERSIONS?=3.0.17 3.1.12 3.2.24 3.3.17 3.4.3
# LATEST_ETCD_VERSION identifies the most recent etcd version available.
LATEST_ETCD_VERSION?=3.3.17
LATEST_ETCD_VERSION?=3.4.3
# REVISION provides a version number fo this image and all it's bundled
# artifacts. It should start at zero for each LATEST_ETCD_VERSION and increment
@@ -113,11 +113,16 @@ else
arch_prefix="GOARM=$(GOARM)"
endif
# use '/go/src/go.etcd.io/etcd' to build etcd 3.4 and later.
for version in $(BUNDLED_ETCD_VERSIONS); do \
etcd_release_tmp_dir=$(shell mktemp -d); \
etcd_build_dir="/go/src/github.com/coreos/etcd"; \
if [ $$(echo $$version | cut -d. -f2) -gt 3 ]; then \
etcd_build_dir="/go/src/go.etcd.io/etcd"; \
fi; \
docker run --interactive -v $${etcd_release_tmp_dir}:/etcdbin golang:$(GOLANG_VERSION)$(DOCKER_VOL_OPTS) /bin/bash -c \
"git clone https://github.com/coreos/etcd /go/src/github.com/coreos/etcd \
&& cd /go/src/github.com/coreos/etcd \
"git clone https://github.com/coreos/etcd $$etcd_build_dir \
&& cd $$etcd_build_dir \
&& git checkout v$${version} \
&& $(arch_prefix) GOARCH=$(ARCH) ./build \
&& cp -f bin/$(ARCH)/etcd* bin/etcd* /etcdbin; echo 'done'"; \

View File

@@ -26,7 +26,7 @@ server.
`migrate` writes a `version.txt` file to track the "current" version
of etcd that was used to persist data to disk. A "target" version may also be provided
by the `TARGET_STORAGE` (e.g. "etcd3") and `TARGET_VERSION` (e.g. "3.3.15" )
by the `TARGET_STORAGE` (e.g. "etcd3") and `TARGET_VERSION` (e.g. "3.4.3" )
environment variables. If the persisted version differs from the target version,
`migrate-if-needed.sh` will migrate the data from the current to the target
version.

View File

@@ -18,7 +18,8 @@
# This script performs etcd upgrade based on the following environmental
# variables:
# TARGET_STORAGE - API of etcd to be used (supported: 'etcd3')
# TARGET_VERSION - etcd release to be used (supported: '3.0.17', '3.1.12', '3.2.24', "3.3.17")
# TARGET_VERSION - etcd release to be used (supported: '3.0.17', '3.1.12',
# '3.2.24', "3.3.17", "3.4.3")
# DATA_DIRECTORY - directory with etcd data
#
# The current etcd version and storage format is detected based on the
@@ -29,6 +30,7 @@
# - 3.0.17/etcd3 -> 3.1.12/etcd3
# - 3.1.12/etcd3 -> 3.2.24/etcd3
# - 3.2.24/etcd3 -> 3.3.17/etcd3
# - 3.3.17/etcd3 -> 3.4.3/etcd3
#
# NOTE: The releases supported in this script has to match release binaries
# present in the etcd image (to make this script work correctly).
@@ -41,7 +43,7 @@ set -o nounset
# NOTE: BUNDLED_VERSION has to match release binaries present in the
# etcd image (to make this script work correctly).
BUNDLED_VERSIONS="3.0.17, 3.1.12, 3.2.24, 3.3.17"
BUNDLED_VERSIONS="3.0.17, 3.1.12, 3.2.24, 3.3.17, 3.4.3"
ETCD_NAME="${ETCD_NAME:-etcd-$(hostname)}"
if [ -z "${DATA_DIRECTORY:-}" ]; then