mirror of https://github.com/k3s-io/k3s
Rename TEST_ETCD_VERSION to ETCD_VERSION
parent
5ded63a635
commit
7ee7b55c5e
|
@ -702,9 +702,9 @@ NUM_NODES: $(yaml-quote ${NUM_NODES})
|
||||||
STORAGE_BACKEND: $(yaml-quote ${STORAGE_BACKEND:-})
|
STORAGE_BACKEND: $(yaml-quote ${STORAGE_BACKEND:-})
|
||||||
ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-})
|
ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-})
|
||||||
EOF
|
EOF
|
||||||
if [ -n "${TEST_ETCD_VERSION:-}" ]; then
|
if [ -n "${ETCD_VERSION:-}" ]; then
|
||||||
cat >>$file <<EOF
|
cat >>$file <<EOF
|
||||||
TEST_ETCD_VERSION: $(yaml-quote ${TEST_ETCD_VERSION})
|
ETCD_VERSION: $(yaml-quote ${ETCD_VERSION})
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ -n "${APISERVER_TEST_ARGS:-}" ]; then
|
if [ -n "${APISERVER_TEST_ARGS:-}" ]; then
|
||||||
|
|
|
@ -95,7 +95,7 @@ ENABLE_L7_LOADBALANCING="${KUBE_ENABLE_L7_LOADBALANCING:-glbc}"
|
||||||
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-influxdb}"
|
ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-influxdb}"
|
||||||
|
|
||||||
# Set etcd version (e.g. 3.0.4-migration.1) if you need non-default version.
|
# Set etcd version (e.g. 3.0.4-migration.1) if you need non-default version.
|
||||||
TEST_ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
||||||
|
|
||||||
# Default Log level for all components in test clusters and variables to override it in specific components.
|
# Default Log level for all components in test clusters and variables to override it in specific components.
|
||||||
TEST_CLUSTER_LOG_LEVEL="${TEST_CLUSTER_LOG_LEVEL:---v=4}"
|
TEST_CLUSTER_LOG_LEVEL="${TEST_CLUSTER_LOG_LEVEL:---v=4}"
|
||||||
|
|
|
@ -471,9 +471,9 @@ kubelet_port: '$(echo "$KUBELET_PORT" | sed -e "s/'/''/g")'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
# Configuration changes for test clusters
|
# Configuration changes for test clusters
|
||||||
if [ -n "${TEST_ETCD_VERSION:-}" ]; then
|
if [ -n "${ETCD_VERSION:-}" ]; then
|
||||||
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
cat <<EOF >>/srv/salt-overlay/pillar/cluster-params.sls
|
||||||
etcd_docker_tag: '$(echo "$TEST_ETCD_VERSION" | sed -e "s/'/''/g")'
|
etcd_docker_tag: '$(echo "$ETCD_VERSION" | sed -e "s/'/''/g")'
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
if [ -n "${APISERVER_TEST_ARGS:-}" ]; then
|
if [ -n "${APISERVER_TEST_ARGS:-}" ]; then
|
||||||
|
|
|
@ -628,8 +628,8 @@ function prepare-etcd-manifest {
|
||||||
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${temp_file}"
|
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${temp_file}"
|
||||||
sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}"
|
sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}"
|
||||||
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${temp_file}"
|
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${temp_file}"
|
||||||
if [[ -n "${TEST_ETCD_VERSION:-}" ]]; then
|
if [[ -n "${ETCD_VERSION:-}" ]]; then
|
||||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${TEST_ETCD_VERSION}@g" "${temp_file}"
|
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${ETCD_VERSION}@g" "${temp_file}"
|
||||||
else
|
else
|
||||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@\1@g" "${temp_file}"
|
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@\1@g" "${temp_file}"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -458,8 +458,8 @@ prepare_etcd_manifest() {
|
||||||
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${etcd_temp_file}"
|
sed -i -e "s@{{ *etcd_cluster *}}@$etcd_cluster@g" "${etcd_temp_file}"
|
||||||
sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}"
|
sed -i -e "s@{{ *storage_backend *}}@${STORAGE_BACKEND:-}@g" "${temp_file}"
|
||||||
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${etcd_temp_file}"
|
sed -i -e "s@{{ *cluster_state *}}@$cluster_state@g" "${etcd_temp_file}"
|
||||||
if [[ -n "${TEST_ETCD_VERSION:-}" ]]; then
|
if [[ -n "${ETCD_VERSION:-}" ]]; then
|
||||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${TEST_ETCD_VERSION}@g" "${etcd_temp_file}"
|
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@${ETCD_VERSION}@g" "${etcd_temp_file}"
|
||||||
else
|
else
|
||||||
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@\1@g" "${etcd_temp_file}"
|
sed -i -e "s@{{ *pillar\.get('etcd_docker_tag', '\(.*\)') *}}@\1@g" "${etcd_temp_file}"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -47,7 +47,7 @@ RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
|
||||||
TERMINATED_POD_GC_THRESHOLD=${TERMINATED_POD_GC_THRESHOLD:-100}
|
TERMINATED_POD_GC_THRESHOLD=${TERMINATED_POD_GC_THRESHOLD:-100}
|
||||||
|
|
||||||
# Set etcd version (e.g. 3.0.4-migration.1) if you need non-default version.
|
# Set etcd version (e.g. 3.0.4-migration.1) if you need non-default version.
|
||||||
TEST_ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
ETCD_VERSION="${TEST_ETCD_VERSION:-}"
|
||||||
# Storage backend. 'etcd2' supported, 'etcd3' experimental.
|
# Storage backend. 'etcd2' supported, 'etcd3' experimental.
|
||||||
STORAGE_BACKEND=${STORAGE_BACKEND:-etcd2}
|
STORAGE_BACKEND=${STORAGE_BACKEND:-etcd2}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,18 @@
|
||||||
source "${KUBE_ROOT}/cluster/kubemark/config-default.sh"
|
source "${KUBE_ROOT}/cluster/kubemark/config-default.sh"
|
||||||
source "${KUBE_ROOT}/cluster/kubemark/util.sh"
|
source "${KUBE_ROOT}/cluster/kubemark/util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/lib/util.sh"
|
source "${KUBE_ROOT}/cluster/lib/util.sh"
|
||||||
|
|
||||||
|
# hack/lib/init.sh will ovewrite ETCD_VERSION if this is unset
|
||||||
|
# what what is default in hack/lib/etcd.sh
|
||||||
|
# To avoid it, if it is empty, we set it to 'avoid-overwrite' and
|
||||||
|
# clean it after that.
|
||||||
|
if [ -z "${ETCD_VERSION}" ]; then
|
||||||
|
ETCD_VERSION="avoid-overwrite"
|
||||||
|
fi
|
||||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
if [ "${ETCD_VERSION}" == "avoid-overwrite" ]; then
|
||||||
|
ETCD_VERSION=""
|
||||||
|
fi
|
||||||
|
|
||||||
detect-project &> /dev/null
|
detect-project &> /dev/null
|
||||||
export PROJECT
|
export PROJECT
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
EVENT_STORE_IP=$1
|
EVENT_STORE_IP=$1
|
||||||
EVENT_STORE_URL="http://${EVENT_STORE_IP}:4002"
|
EVENT_STORE_URL="http://${EVENT_STORE_IP}:4002"
|
||||||
NUM_NODES=$2
|
NUM_NODES=$2
|
||||||
TEST_ETCD_VERSION=$3
|
KUBEMARK_ETCD_VERSION=$3
|
||||||
if [[ -z "${TEST_ETCD_VERSION}" ]]; then
|
if [[ -z "${KUBEMARK_ETCD_VERSION}" ]]; then
|
||||||
# Default etcd version.
|
# Default etcd version.
|
||||||
TEST_ETCD_VERSION="2.2.1"
|
KUBEMARK_ETCD_VERSION="2.2.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function retry() {
|
function retry() {
|
||||||
|
@ -80,7 +80,7 @@ if [ "${EVENT_STORE_IP}" == "127.0.0.1" ]; then
|
||||||
# Retry starting etcd to avoid pulling image errors.
|
# Retry starting etcd to avoid pulling image errors.
|
||||||
retry sudo docker run --net=host \
|
retry sudo docker run --net=host \
|
||||||
-v /var/etcd/data-events:/var/etcd/data -v /var/log:/var/log -d \
|
-v /var/etcd/data-events:/var/etcd/data -v /var/log:/var/log -d \
|
||||||
gcr.io/google_containers/etcd:${TEST_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
|
gcr.io/google_containers/etcd:${KUBEMARK_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
|
||||||
--listen-peer-urls http://127.0.0.1:2381 \
|
--listen-peer-urls http://127.0.0.1:2381 \
|
||||||
--advertise-client-urls=http://127.0.0.1:4002 \
|
--advertise-client-urls=http://127.0.0.1:4002 \
|
||||||
--listen-client-urls=http://0.0.0.0:4002 \
|
--listen-client-urls=http://0.0.0.0:4002 \
|
||||||
|
@ -90,7 +90,7 @@ fi
|
||||||
# Retry starting etcd to avoid pulling image errors.
|
# Retry starting etcd to avoid pulling image errors.
|
||||||
retry sudo docker run --net=host \
|
retry sudo docker run --net=host \
|
||||||
-v /var/etcd/data:/var/etcd/data -v /var/log:/var/log -d \
|
-v /var/etcd/data:/var/etcd/data -v /var/log:/var/log -d \
|
||||||
gcr.io/google_containers/etcd:${TEST_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
|
gcr.io/google_containers/etcd:${KUBEMARK_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
|
||||||
--listen-peer-urls http://127.0.0.1:2380 \
|
--listen-peer-urls http://127.0.0.1:2380 \
|
||||||
--advertise-client-urls=http://127.0.0.1:2379 \
|
--advertise-client-urls=http://127.0.0.1:2379 \
|
||||||
--listen-client-urls=http://0.0.0.0:2379 \
|
--listen-client-urls=http://0.0.0.0:2379 \
|
||||||
|
|
|
@ -148,7 +148,7 @@ gcloud compute copy-files --zone="${ZONE}" --project="${PROJECT}" \
|
||||||
|
|
||||||
gcloud compute ssh "${MASTER_NAME}" --zone="${ZONE}" --project="${PROJECT}" \
|
gcloud compute ssh "${MASTER_NAME}" --zone="${ZONE}" --project="${PROJECT}" \
|
||||||
--command="chmod a+x configure-kubectl.sh && chmod a+x start-kubemark-master.sh && \
|
--command="chmod a+x configure-kubectl.sh && chmod a+x start-kubemark-master.sh && \
|
||||||
sudo ./start-kubemark-master.sh ${EVENT_STORE_IP:-127.0.0.1} ${NUM_NODES:-0} ${TEST_ETCD_VERSION:-}"
|
sudo ./start-kubemark-master.sh ${EVENT_STORE_IP:-127.0.0.1} ${NUM_NODES:-0} ${ETCD_VERSION:-}"
|
||||||
|
|
||||||
# create kubeconfig for Kubelet:
|
# create kubeconfig for Kubelet:
|
||||||
KUBECONFIG_CONTENTS=$(echo "apiVersion: v1
|
KUBECONFIG_CONTENTS=$(echo "apiVersion: v1
|
||||||
|
|
Loading…
Reference in New Issue