Bumping k8s dependencies to 1.13

This commit is contained in:
Cheng Xing
2018-11-16 14:08:25 -08:00
parent 305407125c
commit b4c0b68ec7
8002 changed files with 884099 additions and 276228 deletions

View File

@@ -14,13 +14,13 @@
.PHONY: build push
ETCD_VERSION = 3.2.18
ETCD_VERSION = 3.2.24
# 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.2.18.0
TAG = 3.2.24.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=2.2.1 2.3.7 3.0.17 3.1.12 3.2.18] [REGISTRY=k8s.gcr.io] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
# [BUNDLED_ETCD_VERSIONS=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24] [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,25 +26,31 @@
# 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?=2.2.1 2.3.7 3.0.17 3.1.12 3.2.18
BUNDLED_ETCD_VERSIONS?=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24
# LATEST_ETCD_VERSION identifies the most recent etcd version available.
LATEST_ETCD_VERSION?=3.2.18
LATEST_ETCD_VERSION?=3.2.24
# 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
# for each revision of this image at that etcd version.
REVISION?=0
REVISION?=1
# IMAGE_TAG Uniquely identifies k8s.gcr.io/etcd docker image with a tag of the form "<etcd-version>-<revision>".
IMAGE_TAG=$(LATEST_ETCD_VERSION)-$(REVISION)
ARCH?=amd64
ALL_ARCH = amd64 arm arm64 ppc64le s390x
# 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
MANIFEST_IMAGE := $(PUSH_REGISTRY)/etcd
# This option is for running docker manifest command
export DOCKER_CLI_EXPERIMENTAL := enabled
# golang version should match the golang version from https://github.com/coreos/etcd/releases for the current ETCD_VERSION.
GOLANG_VERSION?=1.8.7
GOARM=7
@@ -118,14 +124,25 @@ endif
docker build --pull -t $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(TEMP_DIR)
push: build
docker tag $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(PUSH_REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG)
docker push $(PUSH_REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG)
docker tag $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(MANIFEST_IMAGE)-$(ARCH):$(IMAGE_TAG)
docker push $(MANIFEST_IMAGE)-$(ARCH):$(IMAGE_TAG)
ifeq ($(ARCH),amd64)
# Backward compatibility. TODO: deprecate this image tag
docker tag $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(PUSH_REGISTRY)/etcd:$(IMAGE_TAG)
docker push $(PUSH_REGISTRY)/etcd:$(IMAGE_TAG)
endif
sub-build-%:
$(MAKE) ARCH=$* build
all-build: $(addprefix sub-build-,$(ALL_ARCH))
sub-push-image-%:
$(MAKE) ARCH=$* push
all-push-images: $(addprefix sub-push-image-,$(ALL_ARCH))
all-push: all-push-images push-manifest
push-manifest:
docker manifest create --amend $(MANIFEST_IMAGE):$(IMAGE_TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(MANIFEST_IMAGE)\-&:$(IMAGE_TAG)~g")
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${MANIFEST_IMAGE}:${IMAGE_TAG} ${MANIFEST_IMAGE}-$${arch}:${IMAGE_TAG}; done
docker manifest push ${MANIFEST_IMAGE}:${IMAGE_TAG}
unit-test:
docker run --interactive -v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes -e GOARCH=$(ARCH) golang:$(GOLANG_VERSION) \
@@ -146,5 +163,5 @@ integration-test:
integration-build-test: build-integration-test-image integration-test
test: unit-test integration-build-test
all: build test
.PHONY: build push unit-test build-integration-test-image integration-test integration-build-test test
all: all-build test
.PHONY: build push push-manifest all-push all-push-images all-build unit-test build-integration-test-image integration-test integration-build-test test

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.2.11" )
by the `TARGET_STORAGE` (e.g. "etcd3") and `TARGET_VERSION` (e.g. "3.2.24" )
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.
@@ -62,22 +62,14 @@ $ make build test
Last, build and push the docker images for all supported architectures.
```console
# Build for linux/amd64 (default)
$ make push ARCH=amd64
# ---> staging-k8s.gcr.io/etcd-amd64:TAG
# ---> staging-k8s.gcr.io/etcd:TAG
# Build images for all the architecture and push the manifest image as well
$ make all-push
$ make push ARCH=arm
# ---> staging-k8s.gcr.io/etcd-arm:TAG
# Build images for all the architecture
$ make all-build
$ make push ARCH=arm64
# ---> staging-k8s.gcr.io/etcd-arm64:TAG
$ make push ARCH=ppc64le
# ---> staging-k8s.gcr.io/etcd-ppc64le:TAG
$ make push ARCH=s390x
# ---> staging-k8s.gcr.io/etcd-s390x:TAG
# Build image for target architecture(default=amd64)
$ make build ARCH=ppc64le
```
If you don't want to push the images, run `make` or `make build` instead

View File

@@ -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.12', '3.2.18')
# TARGET_VERSION - etcd release to be used (supported: '2.2.1', '2.3.7', '3.0.17', '3.1.12', '3.2.24')
# DATA_DIRECTORY - directory with etcd data
#
# The current etcd version and storage format is detected based on the
@@ -29,7 +29,7 @@
# - 2.2.1/etcd2 -> 2.3.7/etcd2
# - 2.3.7/etcd2 -> 3.0.17/etcd2
# - 3.0.17/etcd3 -> 3.1.12/etcd3
# - 3.1.12/etcd3 -> 3.2.18/etcd3
# - 3.1.12/etcd3 -> 3.2.24/etcd3
#
# NOTE: The releases supported in this script has to match release binaries
# present in the etcd image (to make this script work correctly).
@@ -42,7 +42,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="2.2.1, 2.3.7, 3.0.17, 3.1.12, 3.2.18"
BUNDLED_VERSIONS="2.2.1, 2.3.7, 3.0.17, 3.1.12, 3.2.24"
ETCD_NAME="${ETCD_NAME:-etcd-$(hostname)}"
if [ -z "${DATA_DIRECTORY:-}" ]; then

View File

@@ -39,7 +39,7 @@ func TestExistingDataDirWithVersionFile(t *testing.T) {
t.Fatalf("Failed to check if data dir is empty: %v", err)
}
if isEmpty {
t.Errorf("Data directory is non-empty")
t.Errorf("Expected non-empty data directory to exist")
}
exists, err := d.versionFile.Exists()
if err != nil {
@@ -97,7 +97,7 @@ func TestNonexistingDataDir(t *testing.T) {
t.Fatalf("Failed to check if data dir is empty: %v", err)
}
if !isEmpty {
t.Errorf("Data directory is empty")
t.Errorf("Expected empty data directory to exist")
}
err = d.Initialize(targetVersion)
if err != nil {
@@ -115,7 +115,7 @@ func TestNonexistingDataDir(t *testing.T) {
t.Fatalf("Failed to check if data dir is empty: %v", err)
}
if isEmpty {
t.Errorf("Data directory is non-empty")
t.Errorf("Expected non-empty data directory to exist after Initialize()")
}
vp, err := d.versionFile.Read()
if err != nil {
@@ -145,7 +145,7 @@ func TestBackup(t *testing.T) {
t.Fatal(err)
}
if isEmpty {
t.Errorf("Expected non-empty backup directory afer Backup()")
t.Errorf("Expected non-empty backup directory to exist after Backup()")
}
}

View File

@@ -22,7 +22,7 @@ ARCH?=amd64
OUT_DIR?=_output
HYPERKUBE_BIN?=$(shell pwd)/../../../$(OUT_DIR)/dockerized/bin/linux/$(ARCH)/hyperkube
BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.10
BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.10.2
TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX)
all: build
@@ -39,8 +39,10 @@ endif
cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile
ifneq ($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static:register --reset
endif
docker build --pull -t ${REGISTRY}/hyperkube-${ARCH}:${VERSION} ${TEMP_DIR}
rm -rf "${TEMP_DIR}"

View File

@@ -6,3 +6,5 @@ approvers:
- ixdy
- luxas
- mikedanese
labels:
- sig/release