From add8560dfaac3a7a7f1e3c9af0dbe43cf4dc088b Mon Sep 17 00:00:00 2001 From: TommyLike Date: Thu, 21 Mar 2019 10:39:48 +0800 Subject: [PATCH] Update kind version --- .travis.yml | 5 +++-- hack/e2e-kind-config.yaml | 2 +- hack/run-e2e-kind.sh | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3fbe0b6b2f..4492d9aadb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,9 @@ jobs: - echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list - sudo apt-get update - sudo apt-get install -y kubectl - # Download and build kind - - go get sigs.k8s.io/kind + # Download kind binary (0.2.0) + - curl -o /usr/local/bin/kind -L https://github.com/kubernetes-sigs/kind/releases/download/0.2.0/kind-linux-amd64 + - chmod +x /usr/local/bin/kind script: - make cli - make docker diff --git a/hack/e2e-kind-config.yaml b/hack/e2e-kind-config.yaml index 317d7160a6..524732e47a 100644 --- a/hack/e2e-kind-config.yaml +++ b/hack/e2e-kind-config.yaml @@ -8,4 +8,4 @@ nodes: # the three workers - role: worker # replicas specifies the number of nodes to create with this configuration - replicas: 3 \ No newline at end of file + replicas: 3 diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index 778a659515..8c1c667e85 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -5,8 +5,10 @@ export VK_BIN=${VK_ROOT}/_output/bin export LOG_LEVEL=3 export SHOW_VOLCANO_LOGS=${SHOW_VOLCANO_LOGS:-1} -if [ "${CLUSTER_NAME}xxx" != "xxx" ];then +if [[ "${CLUSTER_NAME}xxx" != "xxx" ]];then export CLUSTER_CONTEXT="--name ${CLUSTER_NAME}" +else + export CLUSTER_CONTEXT="--name integration" fi export KIND_OPT=${KIND_OPT:=" --config ${VK_ROOT}/hack/e2e-kind-config.yaml"} @@ -15,7 +17,7 @@ export KIND_OPT=${KIND_OPT:=" --config ${VK_ROOT}/hack/e2e-kind-config.yaml"} function check-prerequisites { echo "checking prerequisites" which kind >/dev/null 2>&1 - if [ $? -ne 0 ]; then + if [[ $? -ne 0 ]]; then echo "kind not installed, exiting." exit 1 else @@ -23,7 +25,7 @@ function check-prerequisites { fi which kubectl >/dev/null 2>&1 - if [ $? -ne 0 ]; then + if [[ $? -ne 0 ]]; then echo "kubectl not installed, exiting." exit 1 else @@ -50,9 +52,9 @@ function install-volcano { helm init --service-account tiller --kubeconfig ${KUBECONFIG} --wait echo "Loading docker images into kind cluster" - kind load docker-image ${IMAGE}-controllers:${TAG} - kind load docker-image ${IMAGE}-scheduler:${TAG} - kind load docker-image ${IMAGE}-admission:${TAG} + kind load docker-image ${IMAGE}-controllers:${TAG} ${CLUSTER_CONTEXT} + kind load docker-image ${IMAGE}-scheduler:${TAG} ${CLUSTER_CONTEXT} + kind load docker-image ${IMAGE}-admission:${TAG} ${CLUSTER_CONTEXT} echo "Install volcano plugin into cluster...." helm plugin install --kubeconfig ${KUBECONFIG} installer/chart/volcano/plugins/gen-admission-secret @@ -73,17 +75,17 @@ function cleanup { echo "Running kind: [kind delete cluster ${CLUSTER_CONTEXT}]" kind delete cluster ${CLUSTER_CONTEXT} - if [ ${SHOW_VOLCANO_LOGS} -eq 1 ]; then + if [[ ${SHOW_VOLCANO_LOGS} -eq 1 ]]; then #TODO: Add volcano logs support in future. echo "Volcano logs are currently not supported." fi } echo $* | grep -E -q "\-\-help|\-h" -if [ $? -eq 0 ]; then +if [[ $? -eq 0 ]]; then echo "Customize the kind-cluster name: - export CLUSTER_NAME= + export CLUSTER_NAME= # default: integration Customize kind options other than --name: