Make it possible to set etcd version in kubemark

pull/6/head
Wojciech Tyczynski 2016-09-27 11:46:00 +02:00
parent 1e7fa1f6cd
commit 8abf3c1600
3 changed files with 15 additions and 3 deletions

View File

@ -45,6 +45,11 @@ CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.240.0.0/13}"
RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}"
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.
TEST_ETCD_VERSION="${TEST_ETCD_VERSION:-}"
# Storage backend. 'etcd2' supported, 'etcd3' experimental.
STORAGE_BACKEND=${STORAGE_BACKEND:-etcd2}
# 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=2}"
KUBELET_TEST_LOG_LEVEL="${KUBELET_TEST_LOG_LEVEL:-$TEST_CLUSTER_LOG_LEVEL}"

View File

@ -19,6 +19,11 @@
EVENT_STORE_IP=$1
EVENT_STORE_URL="http://${EVENT_STORE_IP}:4002"
NUM_NODES=$2
TEST_ETCD_VERSION=$3
if [[ -z "${TEST_ETCD_VERSION}" ]]; then
# Default etcd version.
TEST_ETCD_VERSION="2.2.1"
fi
retry() {
for i in {1..4}; do
@ -31,7 +36,7 @@ if [ "${EVENT_STORE_IP}" == "127.0.0.1" ]; then
# Retry starting etcd to avoid pulling image errors.
retry sudo docker run --net=host \
-v /var/etcd/data-events:/var/etcd/data -v /var/log:/var/log -d \
gcr.io/google_containers/etcd:2.2.1 /bin/sh -c "/usr/local/bin/etcd \
gcr.io/google_containers/etcd:${TEST_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
--listen-peer-urls http://127.0.0.1:2381 \
--advertise-client-urls=http://127.0.0.1:4002 \
--listen-client-urls=http://0.0.0.0:4002 \
@ -41,7 +46,7 @@ fi
# Retry starting etcd to avoid pulling image errors.
retry sudo docker run --net=host \
-v /var/etcd/data:/var/etcd/data -v /var/log:/var/log -d \
gcr.io/google_containers/etcd:2.2.1 /bin/sh -c "/usr/local/bin/etcd \
gcr.io/google_containers/etcd:${TEST_ETCD_VERSION} /bin/sh -c "/usr/local/bin/etcd \
--listen-peer-urls http://127.0.0.1:2380 \
--advertise-client-urls=http://127.0.0.1:2379 \
--listen-client-urls=http://0.0.0.0:2379 \

View File

@ -25,6 +25,7 @@ source "${KUBE_ROOT}/test/kubemark/common.sh"
function writeEnvironmentFiles() {
cat > "${RESOURCE_DIRECTORY}/apiserver_flags" <<EOF
${APISERVER_TEST_ARGS}
--storage-backend=${STORAGE_BACKEND}
--service-cluster-ip-range="${SERVICE_CLUSTER_IP_RANGE}"
EOF
sed -i'' -e "s/\"//g" "${RESOURCE_DIRECTORY}/apiserver_flags"
@ -145,7 +146,8 @@ gcloud compute copy-files --zone="${ZONE}" --project="${PROJECT}" \
"${MASTER_NAME}":~
gcloud compute ssh "${MASTER_NAME}" --zone="${ZONE}" --project="${PROJECT}" \
--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}"
--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:-}"
# create kubeconfig for Kubelet:
KUBECONFIG_CONTENTS=$(echo "apiVersion: v1