Skip to content

Commit

Permalink
Bump to etcd 3.1.12 to pick up critical fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbetz committed Mar 9, 2018
1 parent 71b40cb commit e2a25f9
Show file tree
Hide file tree
Showing 20 changed files with 83 additions and 73 deletions.
2 changes: 1 addition & 1 deletion build/build-image/cross/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ RUN go get golang.org/x/tools/cmd/cover \
golang.org/x/tools/cmd/goimports

# Download and symlink etcd. We need this for our integration tests.
RUN export ETCD_VERSION=v3.1.11; \
RUN export ETCD_VERSION=v3.1.12; \
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
4 changes: 2 additions & 2 deletions build/root/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ http_archive(
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"],
)

ETCD_VERSION = "3.1.11"
ETCD_VERSION = "3.1.12"

new_http_archive(
name = "com_coreos_etcd",
build_file = "third_party/etcd.BUILD",
sha256 = "b80c6c0719beee703821ece80f9e48b071ad5f59bb284bd3ea2104700738d9ec",
sha256 = "4b22184bef1bba8b4908b14bae6af4a6d33ec2b91e4f7a240780e07fa43f2111",
strip_prefix = "etcd-v%s-linux-amd64" % ETCD_VERSION,
urls = ["https://github.com/coreos/etcd/releases/download/v%s/etcd-v%s-linux-amd64.tar.gz" % (ETCD_VERSION, ETCD_VERSION)],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ spec:
dnsPolicy: Default
containers:
- name: etcd-empty-dir-cleanup
image: k8s.gcr.io/etcd-empty-dir-cleanup:3.1.11.0
image: k8s.gcr.io/etcd-empty-dir-cleanup:3.1.12.0
2 changes: 1 addition & 1 deletion cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ METADATA_AGENT_VERSION="${KUBE_METADATA_AGENT_VERSION:-0.2-0.0.16-1}"
# Useful for scheduling heapster in large clusters with nodes of small size.
HEAPSTER_MACHINE_TYPE="${HEAPSTER_MACHINE_TYPE:-}"

# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.1.11) if you need
# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.1.12) if you need
# non-default version.
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
ETCD_DOCKER_REPOSITORY="${TEST_ETCD_DOCKER_REPOSITORY:-}"
Expand Down
4 changes: 2 additions & 2 deletions cluster/gce/manifests/etcd.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"containers":[
{
"name": "etcd-container",
"image": "{{ pillar.get('etcd_docker_repository', 'k8s.gcr.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.1.11') }}",
"image": "{{ pillar.get('etcd_docker_repository', 'k8s.gcr.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.1.12') }}",
"resources": {
"requests": {
"cpu": {{ cpulimit }}
Expand All @@ -29,7 +29,7 @@
"value": "{{ pillar.get('storage_backend', 'etcd3') }}"
},
{ "name": "TARGET_VERSION",
"value": "{{ pillar.get('etcd_version', '3.1.11') }}"
"value": "{{ pillar.get('etcd_version', '3.1.12') }}"
},
{ "name": "DATA_DIRECTORY",
"value": "/var/etcd/data{{ suffix }}"
Expand Down
4 changes: 2 additions & 2 deletions cluster/gce/upgrade-aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ export KUBE_GCE_ENABLE_IP_ALIASES=true
export SECONDARY_RANGE_NAME="pods-default"
export STORAGE_BACKEND="etcd3"
export STORAGE_MEDIA_TYPE="application/vnd.kubernetes.protobuf"
export ETCD_IMAGE=3.1.11
export ETCD_VERSION=3.1.11
export ETCD_IMAGE=3.1.12
export ETCD_VERSION=3.1.12

# Upgrade master with updated kube envs
${KUBE_ROOT}/cluster/gce/upgrade.sh -M -l
Expand Down
15 changes: 10 additions & 5 deletions cluster/images/etcd-empty-dir-cleanup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@

.PHONY: build push

ETCD_VERSION = 3.1.11
IMAGE = staging-k8s.gcr.io/etcd-empty-dir-cleanup
TAG = 3.1.11.0
ETCD_VERSION = 3.1.12
# 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.1.12.0

clean:
rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz
Expand All @@ -25,8 +29,9 @@ build: clean
curl -L -O https://github.com/coreos/etcd/releases/download/v$(ETCD_VERSION)/etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz
tar xzvf etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz
cp etcd-v$(ETCD_VERSION)-linux-amd64/etcdctl .
docker build --pull -t $(IMAGE):$(TAG) .
docker build --pull -t $(REGISTRY)/etcd-empty-dir-cleanup:$(TAG) .
rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz

push: build
docker push $(IMAGE):$(TAG)
docker tag $(REGISTRY)/etcd-empty-dir-cleanup:$(TAG) $(PUSH_REGISTRY)/etcd-empty-dir-cleanup:$(TAG)
docker push $(PUSH_REGISTRY)/etcd-empty-dir-cleanup:$(TAG)
19 changes: 12 additions & 7 deletions cluster/images/etcd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Build the etcd image
#
# Usage:
# [TAGS=2.2.1 2.3.7 3.0.17 3.1.11] [REGISTRY=k8s.gcr.io] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
# [TAGS=2.2.1 2.3.7 3.0.17 3.1.12] [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 tag from here.
Expand All @@ -26,12 +26,16 @@
# Except from etcd-$(tag) and etcdctl-$(tag) binaries, we also
# need etcd and etcdctl binaries for backward compatibility reasons.
# That binary will be set to the last tag from $(TAGS).
TAGS?=2.2.1 2.3.7 3.0.17 3.1.11
REGISTRY_TAG?=3.1.11
TAGS?=2.2.1 2.3.7 3.0.17 3.1.12
REGISTRY_TAG?=3.1.12
# ROLLBACK_REGISTRY_TAG specified the tag that REGISTRY_TAG may be rolled back to.
ROLLBACK_REGISTRY_TAG?=3.1.11
ROLLBACK_REGISTRY_TAG?=3.1.12
ARCH?=amd64
# 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
# golang version should match the golang version from https://github.com/coreos/etcd/releases for REGISTRY_TAG version of etcd.
GOLANG_VERSION?=1.8.5
GOARM=7
Expand Down Expand Up @@ -83,10 +87,10 @@ else
# For each release create a tmp dir 'etcd_release_tmp_dir' and unpack the release tar there.
for tag in $(TAGS); do \
etcd_release_tmp_dir=$(shell mktemp -d); \
docker run --interactive -v $$etcd_release_tmp_dir:/etcdbin golang:$(GOLANG_VERSION) /bin/bash -c \
docker run --interactive -v $${etcd_release_tmp_dir}:/etcdbin golang:$(GOLANG_VERSION) /bin/bash -c \
"git clone https://github.com/coreos/etcd /go/src/github.com/coreos/etcd \
&& cd /go/src/github.com/coreos/etcd \
&& git checkout v$$tag \
&& git checkout v$${tag} \
&& GOARM=$(GOARM) GOARCH=$(ARCH) ./build \
&& cp -f bin/$(ARCH)/etcd* bin/etcd* /etcdbin; echo 'done'"; \
cp $$etcd_release_tmp_dir/etcd $$etcd_release_tmp_dir/etcdctl $(TEMP_DIR)/; \
Expand All @@ -108,7 +112,8 @@ endif
docker build --pull -t $(REGISTRY)/etcd-$(ARCH):$(REGISTRY_TAG) $(TEMP_DIR)

push: build
docker push $(REGISTRY)/etcd-$(ARCH):$(REGISTRY_TAG)
docker tag $(REGISTRY)/etcd-$(ARCH):$(REGISTRY_TAG) $(PUSH_REGISTRY)/etcd-$(ARCH):$(REGISTRY_TAG)
docker push $(PUSH_REGISTRY)/etcd-$(ARCH):$(REGISTRY_TAG)

ifeq ($(ARCH),amd64)
# Backward compatibility. TODO: deprecate this image tag
Expand Down
8 changes: 4 additions & 4 deletions cluster/images/etcd/migrate-if-needed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# This script performs etcd upgrade based on the following environmental
# variables:
# TARGET_STORAGE - API of etcd to be used (supported: 'etcd2', 'etcd3')
# TARGET_VERSION - etcd release to be used (supported: '2.2.1', '2.3.7', '3.0.17', '3.1.11')
# TARGET_VERSION - etcd release to be used (supported: '2.2.1', '2.3.7', '3.0.17', '3.1.12')
# DATA_DIRECTORY - directory with etcd data
#
# The current etcd version and storage format is detected based on the
Expand All @@ -28,7 +28,7 @@
# The update workflow support the following upgrade steps:
# - 2.2.1/etcd2 -> 2.3.7/etcd2
# - 2.3.7/etcd2 -> 3.0.17/etcd2
# - 3.0.17/etcd3 -> 3.1.11/etcd3
# - 3.0.17/etcd3 -> 3.1.12/etcd3
#
# NOTE: The releases supported in this script has to match release binaries
# present in the etcd image (to make this script work correctly).
Expand Down Expand Up @@ -64,7 +64,7 @@ rollback_etcd3_minor_version() {
echo "Starting etcd version ${START_VERSION} to capture rollback snapshot."
if ! start_etcd; then
echo "Unable to automatically downgrade etcd: starting etcd version ${START_VERSION} to capture rollback snapshot failed."
echo "See https://coreos.com/etcd/docs/3.1.11/op-guide/recovery.html for manual downgrade options."
echo "See https://coreos.com/etcd/docs/latest/op-guide/recovery.html for manual downgrade options."
exit 1
else
ETCDCTL_API=3 ${ETCDCTL_CMD} snapshot --endpoints "http://127.0.0.1:${ETCD_PORT}" save "${SNAPSHOT_FILE}"
Expand Down Expand Up @@ -138,7 +138,7 @@ fi
# NOTE: SUPPORTED_VERSION has to match release binaries present in the
# etcd image (to make this script work correctly).
# We cannot use array since sh doesn't support it.
SUPPORTED_VERSIONS_STRING="2.2.1 2.3.7 3.0.17 3.1.11"
SUPPORTED_VERSIONS_STRING="2.2.1 2.3.7 3.0.17 3.1.12"
SUPPORTED_VERSIONS=$(echo "${SUPPORTED_VERSIONS_STRING}" | tr " " "\n")

VERSION_FILE="version.txt"
Expand Down
2 changes: 1 addition & 1 deletion cluster/kubemark/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ TERMINATED_POD_GC_THRESHOLD=${TERMINATED_POD_GC_THRESHOLD:-100}
KUBE_APISERVER_REQUEST_TIMEOUT=300
ETCD_COMPACTION_INTERVAL_SEC="${KUBEMARK_ETCD_COMPACTION_INTERVAL_SEC:-}"

# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.1.11) if you need
# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.1.12) if you need
# non-default version.
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
Expand Down
16 changes: 8 additions & 8 deletions cmd/kubeadm/app/cmd/upgrade/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ _____________________________________________________________________
KubeVersion: "v1.9.0",
KubeadmVersion: "v1.9.0",
DNSVersion: "1.14.8",
EtcdVersion: "3.1.11",
EtcdVersion: "3.1.12",
},
},
},
Expand All @@ -149,7 +149,7 @@ Controller Manager v1.8.3 v1.9.0
Scheduler v1.8.3 v1.9.0
Kube Proxy v1.8.3 v1.9.0
Kube DNS 1.14.5 1.14.8
Etcd 3.0.17 3.1.11
Etcd 3.0.17 3.1.12
You can now apply the upgrade by executing the following command:
Expand Down Expand Up @@ -194,7 +194,7 @@ _____________________________________________________________________
KubeVersion: "v1.9.0",
KubeadmVersion: "v1.9.0",
DNSVersion: "1.14.8",
EtcdVersion: "3.1.11",
EtcdVersion: "3.1.12",
},
},
},
Expand Down Expand Up @@ -230,7 +230,7 @@ Controller Manager v1.8.3 v1.9.0
Scheduler v1.8.3 v1.9.0
Kube Proxy v1.8.3 v1.9.0
Kube DNS 1.14.5 1.14.8
Etcd 3.0.17 3.1.11
Etcd 3.0.17 3.1.12
You can now apply the upgrade by executing the following command:
Expand Down Expand Up @@ -259,7 +259,7 @@ _____________________________________________________________________
KubeVersion: "v1.9.0-beta.1",
KubeadmVersion: "v1.9.0-beta.1",
DNSVersion: "1.14.8",
EtcdVersion: "3.1.11",
EtcdVersion: "3.1.12",
},
},
},
Expand All @@ -275,7 +275,7 @@ Controller Manager v1.8.5 v1.9.0-beta.1
Scheduler v1.8.5 v1.9.0-beta.1
Kube Proxy v1.8.5 v1.9.0-beta.1
Kube DNS 1.14.5 1.14.8
Etcd 3.0.17 3.1.11
Etcd 3.0.17 3.1.12
You can now apply the upgrade by executing the following command:
Expand Down Expand Up @@ -304,7 +304,7 @@ _____________________________________________________________________
KubeVersion: "v1.9.0-rc.1",
KubeadmVersion: "v1.9.0-rc.1",
DNSVersion: "1.14.8",
EtcdVersion: "3.1.11",
EtcdVersion: "3.1.12",
},
},
},
Expand All @@ -320,7 +320,7 @@ Controller Manager v1.8.5 v1.9.0-rc.1
Scheduler v1.8.5 v1.9.0-rc.1
Kube Proxy v1.8.5 v1.9.0-rc.1
Kube DNS 1.14.5 1.14.8
Etcd 3.0.17 3.1.11
Etcd 3.0.17 3.1.12
You can now apply the upgrade by executing the following command:
Expand Down
10 changes: 5 additions & 5 deletions cmd/kubeadm/app/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ const (
KubeletBaseConfigurationFile = "kubelet"

// MinExternalEtcdVersion indicates minimum external etcd version which kubeadm supports
MinExternalEtcdVersion = "3.1.11"
MinExternalEtcdVersion = "3.1.12"

// DefaultEtcdVersion indicates the default etcd version that kubeadm uses
DefaultEtcdVersion = "3.1.11"
DefaultEtcdVersion = "3.1.12"

// Etcd defines variable used internally when referring to etcd component
Etcd = "etcd"
Expand Down Expand Up @@ -296,9 +296,9 @@ var (

// SupportedEtcdVersion lists officially supported etcd versions with corresponding kubernetes releases
SupportedEtcdVersion = map[uint8]string{
9: "3.1.11",
10: "3.1.11",
11: "3.1.11",
9: "3.1.12",
10: "3.1.12",
11: "3.1.12",
}
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/kubeadm/app/constants/constants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,22 @@ func TestEtcdSupportedVersion(t *testing.T) {
},
{
kubernetesVersion: "1.9.0",
expectedVersion: version.MustParseSemantic("3.1.11"),
expectedVersion: version.MustParseSemantic("3.1.12"),
expectedError: nil,
},
{
kubernetesVersion: "1.9.2",
expectedVersion: version.MustParseSemantic("3.1.11"),
expectedVersion: version.MustParseSemantic("3.1.12"),
expectedError: nil,
},
{
kubernetesVersion: "1.10.0",
expectedVersion: version.MustParseSemantic("3.1.11"),
expectedVersion: version.MustParseSemantic("3.1.12"),
expectedError: nil,
},
{
kubernetesVersion: "1.10.1",
expectedVersion: version.MustParseSemantic("3.1.11"),
expectedVersion: version.MustParseSemantic("3.1.12"),
expectedError: nil,
},
}
Expand Down
Loading

0 comments on commit e2a25f9

Please sign in to comment.