mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Merge pull request #71615 from jpbetz/etcd-3.3.10-0-image
Update default etcd server to 3.3.10 for kubernetes 1.14
This commit is contained in:
commit
a9b69dc381
@ -22,12 +22,12 @@ http_archive(
|
|||||||
urls = mirror("https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"),
|
urls = mirror("https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"),
|
||||||
)
|
)
|
||||||
|
|
||||||
ETCD_VERSION = "3.2.24"
|
ETCD_VERSION = "3.3.10"
|
||||||
|
|
||||||
http_archive(
|
http_archive(
|
||||||
name = "com_coreos_etcd",
|
name = "com_coreos_etcd",
|
||||||
build_file = "@//third_party:etcd.BUILD",
|
build_file = "@//third_party:etcd.BUILD",
|
||||||
sha256 = "947849dbcfa13927c81236fb76a7c01d587bbab42ab1e807184cd91b026ebed7",
|
sha256 = "1620a59150ec0a0124a65540e23891243feb2d9a628092fb1edcc23974724a45",
|
||||||
strip_prefix = "etcd-v%s-linux-amd64" % ETCD_VERSION,
|
strip_prefix = "etcd-v%s-linux-amd64" % ETCD_VERSION,
|
||||||
urls = mirror("https://github.com/coreos/etcd/releases/download/v%s/etcd-v%s-linux-amd64.tar.gz" % (ETCD_VERSION, ETCD_VERSION)),
|
urls = mirror("https://github.com/coreos/etcd/releases/download/v%s/etcd-v%s-linux-amd64.tar.gz" % (ETCD_VERSION, ETCD_VERSION)),
|
||||||
)
|
)
|
||||||
|
@ -177,7 +177,7 @@ ENABLE_METADATA_AGENT="${KUBE_ENABLE_METADATA_AGENT:-none}"
|
|||||||
# Useful for scheduling heapster in large clusters with nodes of small size.
|
# Useful for scheduling heapster in large clusters with nodes of small size.
|
||||||
HEAPSTER_MACHINE_TYPE="${HEAPSTER_MACHINE_TYPE:-}"
|
HEAPSTER_MACHINE_TYPE="${HEAPSTER_MACHINE_TYPE:-}"
|
||||||
|
|
||||||
# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.2.24-1) if you need
|
# Set etcd image (e.g. k8s.gcr.io/etcd) and version (e.g. 3.3.10-0) if you need
|
||||||
# non-default version.
|
# non-default version.
|
||||||
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
||||||
ETCD_DOCKER_REPOSITORY="${TEST_ETCD_DOCKER_REPOSITORY:-}"
|
ETCD_DOCKER_REPOSITORY="${TEST_ETCD_DOCKER_REPOSITORY:-}"
|
||||||
|
@ -14,4 +14,4 @@ spec:
|
|||||||
dnsPolicy: Default
|
dnsPolicy: Default
|
||||||
containers:
|
containers:
|
||||||
- name: etcd-empty-dir-cleanup
|
- name: etcd-empty-dir-cleanup
|
||||||
image: k8s.gcr.io/etcd-empty-dir-cleanup:3.2.24.0
|
image: k8s.gcr.io/etcd-empty-dir-cleanup:3.3.10.0
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
"containers":[
|
"containers":[
|
||||||
{
|
{
|
||||||
"name": "etcd-container",
|
"name": "etcd-container",
|
||||||
"image": "{{ pillar.get('etcd_docker_repository', 'k8s.gcr.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.2.24-1') }}",
|
"image": "{{ pillar.get('etcd_docker_repository', 'k8s.gcr.io/etcd') }}:{{ pillar.get('etcd_docker_tag', '3.3.10-0') }}",
|
||||||
"resources": {
|
"resources": {
|
||||||
"requests": {
|
"requests": {
|
||||||
"cpu": {{ cpulimit }}
|
"cpu": {{ cpulimit }}
|
||||||
@ -30,7 +30,7 @@
|
|||||||
"value": "{{ pillar.get('storage_backend', 'etcd3') }}"
|
"value": "{{ pillar.get('storage_backend', 'etcd3') }}"
|
||||||
},
|
},
|
||||||
{ "name": "TARGET_VERSION",
|
{ "name": "TARGET_VERSION",
|
||||||
"value": "{{ pillar.get('etcd_version', '3.2.24') }}"
|
"value": "{{ pillar.get('etcd_version', '3.3.10') }}"
|
||||||
},
|
},
|
||||||
{ "name": "DATA_DIRECTORY",
|
{ "name": "DATA_DIRECTORY",
|
||||||
"value": "/var/etcd/data{{ suffix }}"
|
"value": "/var/etcd/data{{ suffix }}"
|
||||||
|
@ -161,8 +161,8 @@ export KUBE_GCE_ENABLE_IP_ALIASES=true
|
|||||||
export SECONDARY_RANGE_NAME="pods-default"
|
export SECONDARY_RANGE_NAME="pods-default"
|
||||||
export STORAGE_BACKEND="etcd3"
|
export STORAGE_BACKEND="etcd3"
|
||||||
export STORAGE_MEDIA_TYPE="application/vnd.kubernetes.protobuf"
|
export STORAGE_MEDIA_TYPE="application/vnd.kubernetes.protobuf"
|
||||||
export ETCD_IMAGE=3.2.24-1
|
export ETCD_IMAGE=3.3.10-0
|
||||||
export ETCD_VERSION=3.2.24
|
export ETCD_VERSION=3.3.10
|
||||||
|
|
||||||
# Upgrade master with updated kube envs
|
# Upgrade master with updated kube envs
|
||||||
${KUBE_ROOT}/cluster/gce/upgrade.sh -M -l
|
${KUBE_ROOT}/cluster/gce/upgrade.sh -M -l
|
||||||
|
@ -14,13 +14,13 @@
|
|||||||
|
|
||||||
.PHONY: build push
|
.PHONY: build push
|
||||||
|
|
||||||
ETCD_VERSION = 3.2.24
|
ETCD_VERSION = 3.3.10
|
||||||
# Image should be pulled from k8s.gcr.io, which will auto-detect
|
# Image should be pulled from k8s.gcr.io, which will auto-detect
|
||||||
# region (us, eu, asia, ...) and pull from the closest.
|
# region (us, eu, asia, ...) and pull from the closest.
|
||||||
REGISTRY = k8s.gcr.io
|
REGISTRY = k8s.gcr.io
|
||||||
# Images should be pushed to staging-k8s.gcr.io.
|
# Images should be pushed to staging-k8s.gcr.io.
|
||||||
PUSH_REGISTRY = staging-k8s.gcr.io
|
PUSH_REGISTRY = staging-k8s.gcr.io
|
||||||
TAG = 3.2.24.0
|
TAG = 3.3.10.0
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz
|
rm -rf etcdctl etcd-v$(ETCD_VERSION)-linux-amd64 etcd-v$(ETCD_VERSION)-linux-amd64.tar.gz
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
# Build the etcd image
|
# Build the etcd image
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# [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)
|
# [BUNDLED_ETCD_VERSIONS=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24 3.3.10] [REGISTRY=k8s.gcr.io] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
|
||||||
#
|
#
|
||||||
# The image contains different etcd versions to simplify
|
# The image contains different etcd versions to simplify
|
||||||
# upgrades. Thus be careful when removing any versions from here.
|
# upgrades. Thus be careful when removing any versions from here.
|
||||||
@ -26,15 +26,15 @@
|
|||||||
# Except from etcd-$(version) and etcdctl-$(version) binaries, we also
|
# Except from etcd-$(version) and etcdctl-$(version) binaries, we also
|
||||||
# need etcd and etcdctl binaries for backward compatibility reasons.
|
# need etcd and etcdctl binaries for backward compatibility reasons.
|
||||||
# That binary will be set to the last version from $(BUNDLED_ETCD_VERSIONS).
|
# 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.24
|
BUNDLED_ETCD_VERSIONS?=2.2.1 2.3.7 3.0.17 3.1.12 3.2.24 3.3.10
|
||||||
|
|
||||||
# LATEST_ETCD_VERSION identifies the most recent etcd version available.
|
# LATEST_ETCD_VERSION identifies the most recent etcd version available.
|
||||||
LATEST_ETCD_VERSION?=3.2.24
|
LATEST_ETCD_VERSION?=3.3.10
|
||||||
|
|
||||||
# REVISION provides a version number fo this image and all it's bundled
|
# 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
|
# artifacts. It should start at zero for each LATEST_ETCD_VERSION and increment
|
||||||
# for each revision of this image at that etcd version.
|
# for each revision of this image at that etcd version.
|
||||||
REVISION?=1
|
REVISION?=0
|
||||||
|
|
||||||
# IMAGE_TAG Uniquely identifies k8s.gcr.io/etcd docker image with a tag of the form "<etcd-version>-<revision>".
|
# 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)
|
IMAGE_TAG=$(LATEST_ETCD_VERSION)-$(REVISION)
|
||||||
@ -52,7 +52,7 @@ MANIFEST_IMAGE := $(PUSH_REGISTRY)/etcd
|
|||||||
# This option is for running docker manifest command
|
# This option is for running docker manifest command
|
||||||
export DOCKER_CLI_EXPERIMENTAL := enabled
|
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 should match the golang version from https://github.com/coreos/etcd/releases for the current ETCD_VERSION.
|
||||||
GOLANG_VERSION?=1.8.7
|
GOLANG_VERSION?=1.10.4
|
||||||
GOARM=7
|
GOARM=7
|
||||||
TEMP_DIR:=$(shell mktemp -d)
|
TEMP_DIR:=$(shell mktemp -d)
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ build-integration-test-image: build
|
|||||||
|
|
||||||
integration-test:
|
integration-test:
|
||||||
docker run --interactive -v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes -e GOARCH=$(ARCH) etcd-integration-test \
|
docker run --interactive -v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes -e GOARCH=$(ARCH) etcd-integration-test \
|
||||||
/bin/bash -c "CGO_ENABLED=0 go test -tags=integration -v k8s.io/kubernetes/cluster/images/etcd/migrate -args -v 10 -logtostderr true"
|
/bin/bash -c "CGO_ENABLED=0 go test -tags=integration k8s.io/kubernetes/cluster/images/etcd/migrate -args -v 10 -logtostderr true"
|
||||||
|
|
||||||
integration-build-test: build-integration-test-image integration-test
|
integration-build-test: build-integration-test-image integration-test
|
||||||
test: unit-test integration-build-test
|
test: unit-test integration-build-test
|
||||||
|
@ -26,7 +26,7 @@ server.
|
|||||||
|
|
||||||
`migrate` writes a `version.txt` file to track the "current" version
|
`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
|
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.24" )
|
by the `TARGET_STORAGE` (e.g. "etcd3") and `TARGET_VERSION` (e.g. "3.3.10" )
|
||||||
environment variables. If the persisted version differs from the target version,
|
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
|
`migrate-if-needed.sh` will migrate the data from the current to the target
|
||||||
version.
|
version.
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# This script performs etcd upgrade based on the following environmental
|
# This script performs etcd upgrade based on the following environmental
|
||||||
# variables:
|
# variables:
|
||||||
# TARGET_STORAGE - API of etcd to be used (supported: 'etcd2', 'etcd3')
|
# 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.24')
|
# TARGET_VERSION - etcd release to be used (supported: '2.2.1', '2.3.7', '3.0.17', '3.1.12', '3.2.24', "3.3.10")
|
||||||
# DATA_DIRECTORY - directory with etcd data
|
# DATA_DIRECTORY - directory with etcd data
|
||||||
#
|
#
|
||||||
# The current etcd version and storage format is detected based on the
|
# The current etcd version and storage format is detected based on the
|
||||||
@ -30,6 +30,7 @@
|
|||||||
# - 2.3.7/etcd2 -> 3.0.17/etcd2
|
# - 2.3.7/etcd2 -> 3.0.17/etcd2
|
||||||
# - 3.0.17/etcd3 -> 3.1.12/etcd3
|
# - 3.0.17/etcd3 -> 3.1.12/etcd3
|
||||||
# - 3.1.12/etcd3 -> 3.2.24/etcd3
|
# - 3.1.12/etcd3 -> 3.2.24/etcd3
|
||||||
|
# - 3.2.24/etcd3 -> 3.3.10/etcd3
|
||||||
#
|
#
|
||||||
# NOTE: The releases supported in this script has to match release binaries
|
# NOTE: The releases supported in this script has to match release binaries
|
||||||
# present in the etcd image (to make this script work correctly).
|
# present in the etcd image (to make this script work correctly).
|
||||||
@ -42,7 +43,7 @@ set -o nounset
|
|||||||
|
|
||||||
# NOTE: BUNDLED_VERSION has to match release binaries present in the
|
# NOTE: BUNDLED_VERSION has to match release binaries present in the
|
||||||
# etcd image (to make this script work correctly).
|
# etcd image (to make this script work correctly).
|
||||||
BUNDLED_VERSIONS="2.2.1, 2.3.7, 3.0.17, 3.1.12, 3.2.24"
|
BUNDLED_VERSIONS="2.2.1, 2.3.7, 3.0.17, 3.1.12, 3.2.24, 3.3.10"
|
||||||
|
|
||||||
ETCD_NAME="${ETCD_NAME:-etcd-$(hostname)}"
|
ETCD_NAME="${ETCD_NAME:-etcd-$(hostname)}"
|
||||||
if [ -z "${DATA_DIRECTORY:-}" ]; then
|
if [ -z "${DATA_DIRECTORY:-}" ]; then
|
||||||
|
@ -250,7 +250,7 @@ const (
|
|||||||
MinExternalEtcdVersion = "3.2.18"
|
MinExternalEtcdVersion = "3.2.18"
|
||||||
|
|
||||||
// DefaultEtcdVersion indicates the default etcd version that kubeadm uses
|
// DefaultEtcdVersion indicates the default etcd version that kubeadm uses
|
||||||
DefaultEtcdVersion = "3.2.24"
|
DefaultEtcdVersion = "3.3.10"
|
||||||
|
|
||||||
// PauseVersion indicates the default pause image version for kubeadm
|
// PauseVersion indicates the default pause image version for kubeadm
|
||||||
PauseVersion = "3.1"
|
PauseVersion = "3.1"
|
||||||
@ -388,6 +388,7 @@ var (
|
|||||||
11: "3.2.18",
|
11: "3.2.18",
|
||||||
12: "3.2.24",
|
12: "3.2.24",
|
||||||
13: "3.2.24",
|
13: "3.2.24",
|
||||||
|
14: "3.3.10",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -155,11 +155,6 @@ func TestEtcdSupportedVersion(t *testing.T) {
|
|||||||
expectedVersion: nil,
|
expectedVersion: nil,
|
||||||
expectedError: errors.New("Unsupported or unknown Kubernetes version(1.99.0)"),
|
expectedError: errors.New("Unsupported or unknown Kubernetes version(1.99.0)"),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
kubernetesVersion: "1.10.0",
|
|
||||||
expectedVersion: version.MustParseSemantic("3.1.12"),
|
|
||||||
expectedError: nil,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
kubernetesVersion: "1.10.2",
|
kubernetesVersion: "1.10.2",
|
||||||
expectedVersion: version.MustParseSemantic("3.1.12"),
|
expectedVersion: version.MustParseSemantic("3.1.12"),
|
||||||
@ -175,6 +170,16 @@ func TestEtcdSupportedVersion(t *testing.T) {
|
|||||||
expectedVersion: version.MustParseSemantic("3.2.24"),
|
expectedVersion: version.MustParseSemantic("3.2.24"),
|
||||||
expectedError: nil,
|
expectedError: nil,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
kubernetesVersion: "1.13.1",
|
||||||
|
expectedVersion: version.MustParseSemantic("3.2.24"),
|
||||||
|
expectedError: nil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
kubernetesVersion: "1.14.0",
|
||||||
|
expectedVersion: version.MustParseSemantic("3.3.10"),
|
||||||
|
expectedError: nil,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
for _, rt := range tests {
|
for _, rt := range tests {
|
||||||
actualVersion, actualError := EtcdSupportedVersion(rt.kubernetesVersion)
|
actualVersion, actualError := EtcdSupportedVersion(rt.kubernetesVersion)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
# A set of helpers for starting/running etcd for tests
|
# A set of helpers for starting/running etcd for tests
|
||||||
|
|
||||||
ETCD_VERSION=${ETCD_VERSION:-3.2.24}
|
ETCD_VERSION=${ETCD_VERSION:-3.3.10}
|
||||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||||
ETCD_PORT=${ETCD_PORT:-2379}
|
ETCD_PORT=${ETCD_PORT:-2379}
|
||||||
export KUBE_INTEGRATION_ETCD_URL="http://${ETCD_HOST}:${ETCD_PORT}"
|
export KUBE_INTEGRATION_ETCD_URL="http://${ETCD_HOST}:${ETCD_PORT}"
|
||||||
|
@ -21,4 +21,4 @@ spec:
|
|||||||
imagePullPolicy: Never
|
imagePullPolicy: Never
|
||||||
command: [ "/kube-sample-apiserver", "--etcd-servers=http://localhost:2379" ]
|
command: [ "/kube-sample-apiserver", "--etcd-servers=http://localhost:2379" ]
|
||||||
- name: etcd
|
- name: etcd
|
||||||
image: quay.io/coreos/etcd:v3.2.24
|
image: quay.io/coreos/etcd:v3.3.10
|
||||||
|
@ -179,7 +179,7 @@ func TestSampleAPIServer(f *framework.Framework, image string) {
|
|||||||
|
|
||||||
// kubectl create -f deploy.yaml
|
// kubectl create -f deploy.yaml
|
||||||
deploymentName := "sample-apiserver-deployment"
|
deploymentName := "sample-apiserver-deployment"
|
||||||
etcdImage := "quay.io/coreos/etcd:v3.2.24"
|
etcdImage := "quay.io/coreos/etcd:v3.3.10"
|
||||||
podLabels := map[string]string{"app": "sample-apiserver", "apiserver": "true"}
|
podLabels := map[string]string{"app": "sample-apiserver", "apiserver": "true"}
|
||||||
replicas := int32(1)
|
replicas := int32(1)
|
||||||
zero := int64(0)
|
zero := int64(0)
|
||||||
|
@ -66,7 +66,7 @@ func etcdUpgradeGCE(target_storage, target_version string) error {
|
|||||||
os.Environ(),
|
os.Environ(),
|
||||||
"TEST_ETCD_VERSION="+target_version,
|
"TEST_ETCD_VERSION="+target_version,
|
||||||
"STORAGE_BACKEND="+target_storage,
|
"STORAGE_BACKEND="+target_storage,
|
||||||
"TEST_ETCD_IMAGE=3.2.24-1")
|
"TEST_ETCD_IMAGE=3.3.10-0")
|
||||||
|
|
||||||
_, _, err := RunCmdEnv(env, gceUpgradeScript(), "-l", "-M")
|
_, _, err := RunCmdEnv(env, gceUpgradeScript(), "-l", "-M")
|
||||||
return err
|
return err
|
||||||
@ -106,7 +106,7 @@ func masterUpgradeGCE(rawV string, enableKubeProxyDaemonSet bool) error {
|
|||||||
env = append(env,
|
env = append(env,
|
||||||
"TEST_ETCD_VERSION="+TestContext.EtcdUpgradeVersion,
|
"TEST_ETCD_VERSION="+TestContext.EtcdUpgradeVersion,
|
||||||
"STORAGE_BACKEND="+TestContext.EtcdUpgradeStorage,
|
"STORAGE_BACKEND="+TestContext.EtcdUpgradeStorage,
|
||||||
"TEST_ETCD_IMAGE=3.2.24-1")
|
"TEST_ETCD_IMAGE=3.3.10-0")
|
||||||
} else {
|
} else {
|
||||||
// In e2e tests, we skip the confirmation prompt about
|
// In e2e tests, we skip the confirmation prompt about
|
||||||
// implicit etcd upgrades to simulate the user entering "y".
|
// implicit etcd upgrades to simulate the user entering "y".
|
||||||
|
@ -64,7 +64,7 @@ SERVICE_CLUSTER_IP_RANGE="${SERVICE_CLUSTER_IP_RANGE:-}"
|
|||||||
EVENT_PD="${EVENT_PD:-}"
|
EVENT_PD="${EVENT_PD:-}"
|
||||||
|
|
||||||
# Etcd related variables.
|
# Etcd related variables.
|
||||||
ETCD_IMAGE="${ETCD_IMAGE:-3.2.24-1}"
|
ETCD_IMAGE="${ETCD_IMAGE:-3.3.10-0}"
|
||||||
ETCD_VERSION="${ETCD_VERSION:-}"
|
ETCD_VERSION="${ETCD_VERSION:-}"
|
||||||
|
|
||||||
# Controller-manager related variables.
|
# Controller-manager related variables.
|
||||||
|
Loading…
Reference in New Issue
Block a user