mirror of https://github.com/k3s-io/k3s
etcd: update version to 3.1.10
parent
dd99659dc1
commit
39e5a56691
|
@ -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.0.17; \
|
||||
RUN export ETCD_VERSION=v3.1.10; \
|
||||
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 \
|
||||
|
|
|
@ -1 +1 @@
|
|||
v1.8.3-2
|
||||
v1.8.3-3
|
||||
|
|
|
@ -12,12 +12,12 @@ http_archive(
|
|||
urls = ["https://github.com/kubernetes/repo-infra/archive/0aafaab9e158d3628804242c6a9c4dd3eb8bce1f.tar.gz"],
|
||||
)
|
||||
|
||||
ETCD_VERSION = "3.0.17"
|
||||
ETCD_VERSION = "3.1.10"
|
||||
|
||||
new_http_archive(
|
||||
name = "com_coreos_etcd",
|
||||
build_file = "third_party/etcd.BUILD",
|
||||
sha256 = "274c46a7f8d26f7ae99d6880610f54933cbcf7f3beafa19236c52eb5df8c7a0b",
|
||||
sha256 = "2d335f298619c6fb02b1124773a56966e448ad9952b26fea52909da4fe80d2be",
|
||||
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)],
|
||||
)
|
||||
|
|
|
@ -143,7 +143,7 @@ ENABLE_METRICS_SERVER="${KUBE_ENABLE_METRICS_SERVER:-true}"
|
|||
# Useful for scheduling heapster in large clusters with nodes of small size.
|
||||
HEAPSTER_MACHINE_TYPE="${HEAPSTER_MACHINE_TYPE:-}"
|
||||
|
||||
# Set etcd image (e.g. 3.0.17-alpha.1) and version (e.g. 3.0.17) if you need
|
||||
# Set etcd image (e.g. gcr.io/google_containers/etcd) and version (e.g. 3.1.10) if you need
|
||||
# non-default version.
|
||||
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
||||
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# Build the etcd image
|
||||
#
|
||||
# Usage:
|
||||
# [TAGS=2.2.1 2.3.7 3.0.17] [REGISTRY=gcr.io/google_containers] [ARCH=amd64] [BASEIMAGE=busybox] make (build|push)
|
||||
# [TAGS=2.2.1 2.3.7 3.0.17 3.1.10] [REGISTRY=gcr.io/google_containers] [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.
|
||||
|
@ -26,8 +26,8 @@
|
|||
# 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
|
||||
REGISTRY_TAG?=3.0.17
|
||||
TAGS?=2.2.1 2.3.7 3.0.17 3.1.10
|
||||
REGISTRY_TAG?=3.1.10
|
||||
ARCH?=amd64
|
||||
REGISTRY?=gcr.io/google_containers
|
||||
GOLANG_VERSION?=1.7.6
|
||||
|
|
|
@ -48,7 +48,7 @@ CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.224.0.0/11}"
|
|||
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
|
||||
TERMINATED_POD_GC_THRESHOLD=${TERMINATED_POD_GC_THRESHOLD:-100}
|
||||
|
||||
# Set etcd image (e.g. 3.0.17-alpha.1) and version (e.g. 3.0.17) if you need
|
||||
# Set etcd image (e.g. gcr.io/google_containers/etcd) and version (e.g. 3.1.10) if you need
|
||||
# non-default version.
|
||||
ETCD_IMAGE="${TEST_ETCD_IMAGE:-}"
|
||||
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"containers":[
|
||||
{
|
||||
"name": "etcd-container",
|
||||
"image": "gcr.io/google_containers/etcd:{{ pillar.get('etcd_docker_tag', '3.0.17') }}",
|
||||
"image": "gcr.io/google_containers/etcd:{{ pillar.get('etcd_docker_tag', '3.1.10') }}",
|
||||
"resources": {
|
||||
"requests": {
|
||||
"cpu": {{ cpulimit }}
|
||||
|
@ -55,7 +55,7 @@
|
|||
"value": "{{ pillar.get('storage_backend', 'etcd3') }}"
|
||||
},
|
||||
{ "name": "TARGET_VERSION",
|
||||
"value": "{{ pillar.get('etcd_version', '3.0.17') }}"
|
||||
"value": "{{ pillar.get('etcd_version', '3.1.10') }}"
|
||||
},
|
||||
{ "name": "DATA_DIRECTORY",
|
||||
"value": "/var/etcd/data{{ suffix }}"
|
||||
|
|
|
@ -148,7 +148,7 @@ const (
|
|||
MinExternalEtcdVersion = "3.0.14"
|
||||
|
||||
// DefaultEtcdVersion indicates the default etcd version that kubeadm uses
|
||||
DefaultEtcdVersion = "3.0.17"
|
||||
DefaultEtcdVersion = "3.1.10"
|
||||
|
||||
// Etcd defines variable used internally when referring to etcd component
|
||||
Etcd = "etcd"
|
||||
|
|
|
@ -30,7 +30,7 @@ import (
|
|||
|
||||
const (
|
||||
hyperkubeImageName = "gcr.io/google_containers/hyperkube-amd64"
|
||||
DefaultEtcdImage = "gcr.io/google_containers/etcd:3.0.17"
|
||||
DefaultEtcdImage = "gcr.io/google_containers/etcd:3.1.10"
|
||||
)
|
||||
|
||||
func GetDefaultServerImage() string {
|
||||
|
|
|
@ -211,7 +211,7 @@ func TestInitFederation(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
defaultEtcdImage := "gcr.io/google_containers/etcd:3.0.17"
|
||||
defaultEtcdImage := "gcr.io/google_containers/etcd:3.1.10"
|
||||
|
||||
//TODO: implement a negative case for dry run
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
# A set of helpers for starting/running etcd for tests
|
||||
|
||||
ETCD_VERSION=${ETCD_VERSION:-3.0.17}
|
||||
ETCD_VERSION=${ETCD_VERSION:-3.1.10}
|
||||
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
|
||||
ETCD_PORT=${ETCD_PORT:-2379}
|
||||
|
||||
|
|
|
@ -32,9 +32,6 @@ KUBE_NEW_API_VERSION=${KUBE_NEW_API_VERSION:-"v1"}
|
|||
KUBE_OLD_STORAGE_VERSIONS=${KUBE_OLD_STORAGE_VERSIONS:-""}
|
||||
KUBE_NEW_STORAGE_VERSIONS=${KUBE_NEW_STORAGE_VERSIONS:-""}
|
||||
|
||||
STORAGE_BACKEND_ETCD2="etcd2"
|
||||
STORAGE_BACKEND_ETCD3="etcd3"
|
||||
|
||||
KUBE_STORAGE_MEDIA_TYPE_JSON="application/json"
|
||||
KUBE_STORAGE_MEDIA_TYPE_PROTOBUF="application/vnd.kubernetes.protobuf"
|
||||
|
||||
|
@ -51,11 +48,9 @@ KUBECTL="${KUBE_OUTPUT_HOSTBIN}/kubectl"
|
|||
UPDATE_ETCD_OBJECTS_SCRIPT="${KUBE_ROOT}/cluster/update-storage-objects.sh"
|
||||
|
||||
function startApiServer() {
|
||||
local storage_backend=${1:-"${STORAGE_BACKEND_ETCD2}"}
|
||||
local storage_versions=${2:-""}
|
||||
local storage_media_type=${3:-""}
|
||||
local storage_versions=${1:-""}
|
||||
local storage_media_type=${2:-""}
|
||||
kube::log::status "Starting kube-apiserver with KUBE_API_VERSIONS: ${KUBE_API_VERSIONS}"
|
||||
kube::log::status " and storage-backend: ${storage_backend}"
|
||||
kube::log::status " and storage-media-type: ${storage_media_type}"
|
||||
kube::log::status " and runtime-config: ${RUNTIME_CONFIG}"
|
||||
kube::log::status " and storage-version overrides: ${storage_versions}"
|
||||
|
@ -65,7 +60,7 @@ function startApiServer() {
|
|||
--insecure-bind-address="${API_HOST}" \
|
||||
--bind-address="${API_HOST}" \
|
||||
--insecure-port="${API_PORT}" \
|
||||
--storage-backend="${storage_backend}" \
|
||||
--storage-backend="etcd3" \
|
||||
--etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \
|
||||
--etcd-prefix="/${ETCD_PREFIX}" \
|
||||
--runtime-config="${RUNTIME_CONFIG}" \
|
||||
|
@ -103,7 +98,7 @@ make -C "${KUBE_ROOT}" WHAT=cmd/kube-apiserver
|
|||
make -C "${KUBE_ROOT}" WHAT=cluster/images/etcd/attachlease
|
||||
|
||||
kube::etcd::start
|
||||
echo "${ETCD_VERSION}/${STORAGE_BACKEND_ETCD2}" > "${ETCD_DIR}/version.txt"
|
||||
echo "${ETCD_VERSION}" > "${ETCD_DIR}/version.txt"
|
||||
|
||||
### BEGIN TEST DEFINITION CUSTOMIZATION ###
|
||||
|
||||
|
@ -126,7 +121,7 @@ KUBE_NEW_STORAGE_VERSIONS="storage.k8s.io/v1"
|
|||
#######################################################
|
||||
KUBE_API_VERSIONS="v1,${KUBE_OLD_API_VERSION},${KUBE_NEW_API_VERSION}"
|
||||
RUNTIME_CONFIG="api/all=false,api/v1=true,${KUBE_OLD_API_VERSION}=true,${KUBE_NEW_API_VERSION}=true"
|
||||
startApiServer ${STORAGE_BACKEND_ETCD2} ${KUBE_OLD_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}
|
||||
startApiServer ${KUBE_OLD_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}
|
||||
|
||||
|
||||
# Create object(s)
|
||||
|
@ -147,38 +142,21 @@ for test in ${tests[@]}; do
|
|||
namespace="${namespace}/"
|
||||
fi
|
||||
kube::log::status "Verifying ${resource}/${namespace}${name} has storage version ${old_storage_version} in etcd"
|
||||
curl -s http://${ETCD_HOST}:${ETCD_PORT}/v2/keys/${ETCD_PREFIX}/${resource}/${namespace}${name} | grep ${old_storage_version}
|
||||
ETCDCTL_API=3 ${ETCDCTL} --endpoints="http://${ETCD_HOST}:${ETCD_PORT}" get "/${ETCD_PREFIX}/${resource}/${namespace}${name}" | grep ${old_storage_version}
|
||||
done
|
||||
|
||||
killApiServer
|
||||
|
||||
|
||||
#######################################################
|
||||
# Step 2: Perform etcd2 -> etcd3 migration.
|
||||
# We always perform offline migration, so we need to stop etcd.
|
||||
#######################################################
|
||||
|
||||
kube::etcd::stop
|
||||
TARGET_STORAGE="etcd3" \
|
||||
TARGET_VERSION="3.0.17" \
|
||||
DATA_DIRECTORY="${ETCD_DIR}" \
|
||||
ETCD=$(which etcd) \
|
||||
ETCDCTL=$(which etcdctl) \
|
||||
ATTACHLEASE="${KUBE_OUTPUT_HOSTBIN}/attachlease" \
|
||||
DO_NOT_MOVE_BINARIES="true" \
|
||||
${KUBE_ROOT}/cluster/images/etcd/migrate-if-needed.sh
|
||||
kube::etcd::start
|
||||
|
||||
|
||||
#######################################################
|
||||
# Step 3: Start a server which supports both the old and new api versions,
|
||||
# Step 2: Start a server which supports both the old and new api versions,
|
||||
# but KUBE_NEW_API_VERSION is the latest (storage) version.
|
||||
# Still use KUBE_STORAGE_MEDIA_TYPE_JSON for storage encoding.
|
||||
#######################################################
|
||||
|
||||
KUBE_API_VERSIONS="v1,${KUBE_NEW_API_VERSION},${KUBE_OLD_API_VERSION}"
|
||||
RUNTIME_CONFIG="api/all=false,api/v1=true,${KUBE_OLD_API_VERSION}=true,${KUBE_NEW_API_VERSION}=true"
|
||||
startApiServer ${STORAGE_BACKEND_ETCD3} ${KUBE_NEW_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_JSON}
|
||||
startApiServer ${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"
|
||||
|
@ -196,14 +174,14 @@ for test in ${tests[@]}; do
|
|||
namespace="${namespace}/"
|
||||
fi
|
||||
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_API=3 ${ETCDCTL} --endpoints="http://${ETCD_HOST}:${ETCD_PORT}" get "/${ETCD_PREFIX}/${resource}/${namespace}${name}" | grep ${new_storage_version}
|
||||
done
|
||||
|
||||
killApiServer
|
||||
|
||||
|
||||
#######################################################
|
||||
# Step 4 : Start a server which supports only the new api version.
|
||||
# Step 3 : Start a server which supports only the new api version.
|
||||
# However, change storage encoding to KUBE_STORAGE_MEDIA_TYPE_PROTOBUF.
|
||||
#######################################################
|
||||
|
||||
|
@ -212,7 +190,7 @@ RUNTIME_CONFIG="api/all=false,api/v1=true,${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}
|
||||
startApiServer ${KUBE_NEW_STORAGE_VERSIONS} ${KUBE_STORAGE_MEDIA_TYPE_PROTOBUF}
|
||||
|
||||
for test in ${tests[@]}; do
|
||||
IFS=',' read -ra test_data <<<"$test"
|
||||
|
|
|
@ -23,4 +23,4 @@ spec:
|
|||
- "--etcd-servers=http://localhost:2379"
|
||||
- "--audit-log-path=-"
|
||||
- name: etcd
|
||||
image: quay.io/coreos/etcd:v3.0.17
|
||||
image: quay.io/coreos/etcd:v3.1.10
|
||||
|
|
|
@ -21,4 +21,4 @@ spec:
|
|||
imagePullPolicy: Never
|
||||
command: [ "/kube-sample-apiserver", "--etcd-servers=http://localhost:2379" ]
|
||||
- name: etcd
|
||||
image: quay.io/coreos/etcd:v3.0.17
|
||||
image: quay.io/coreos/etcd:v3.1.10
|
||||
|
|
|
@ -207,7 +207,7 @@ func TestSampleAPIServer(f *framework.Framework, image, namespaceName string) {
|
|||
|
||||
// kubectl create -f deploy.yaml
|
||||
deploymentName := "sample-apiserver-deployment"
|
||||
etcdImage := "quay.io/coreos/etcd:v3.0.17"
|
||||
etcdImage := "quay.io/coreos/etcd:v3.1.10"
|
||||
podLabels := map[string]string{"app": "sample-apiserver", "apiserver": "true"}
|
||||
replicas := int32(1)
|
||||
zero := int64(0)
|
||||
|
|
|
@ -59,7 +59,7 @@ func etcdUpgradeGCE(target_storage, target_version string) error {
|
|||
os.Environ(),
|
||||
"TEST_ETCD_VERSION="+target_version,
|
||||
"STORAGE_BACKEND="+target_storage,
|
||||
"TEST_ETCD_IMAGE=3.0.17")
|
||||
"TEST_ETCD_IMAGE=3.1.10")
|
||||
|
||||
_, _, err := RunCmdEnv(env, gceUpgradeScript(), "-l", "-M")
|
||||
return err
|
||||
|
@ -78,7 +78,7 @@ func masterUpgradeGCE(rawV string, enableKubeProxyDaemonSet bool) error {
|
|||
env = append(env,
|
||||
"TEST_ETCD_VERSION="+TestContext.EtcdUpgradeVersion,
|
||||
"STORAGE_BACKEND="+TestContext.EtcdUpgradeStorage,
|
||||
"TEST_ETCD_IMAGE=3.0.17")
|
||||
"TEST_ETCD_IMAGE=3.1.10")
|
||||
}
|
||||
|
||||
v := "v" + rawV
|
||||
|
|
|
@ -54,7 +54,7 @@ INSTANCE_PREFIX="${INSTANCE_PREFIX:-}"
|
|||
SERVICE_CLUSTER_IP_RANGE="${SERVICE_CLUSTER_IP_RANGE:-}"
|
||||
|
||||
# Etcd related variables.
|
||||
ETCD_IMAGE="${ETCD_IMAGE:-3.0.17}"
|
||||
ETCD_IMAGE="${ETCD_IMAGE:-3.1.10}"
|
||||
ETCD_VERSION="${ETCD_VERSION:-}"
|
||||
|
||||
# Controller-manager related variables.
|
||||
|
|
Loading…
Reference in New Issue