From ca16a57b54020c48be5946089b416f29dab37b83 Mon Sep 17 00:00:00 2001 From: wizard Date: Fri, 6 Mar 2015 12:04:42 +0800 Subject: [PATCH] Add cleanup function to make the build.sh more robust --- cluster/ubuntu-cluster/build.sh | 8 +++++++- docs/getting-started-guides/ubuntu_multinodes_cluster.md | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cluster/ubuntu-cluster/build.sh b/cluster/ubuntu-cluster/build.sh index 52896f509bc..1dd8b7dd5d1 100755 --- a/cluster/ubuntu-cluster/build.sh +++ b/cluster/ubuntu-cluster/build.sh @@ -17,9 +17,15 @@ # Download the etcd, flannel, and K8s binaries automatically # Run as root only -# author @resouer +# author @resouer @WIZARD-CXY set -e +function cleanup { + # cleanup work + rm -rf flannel kubernetes* etcd* binaries +} +trap cleanup SIGHUP SIGINT SIGTERM + # check root if [ "$(id -u)" != "0" ]; then echo >&2 "Please run as root" diff --git a/docs/getting-started-guides/ubuntu_multinodes_cluster.md b/docs/getting-started-guides/ubuntu_multinodes_cluster.md index ba1173b94c4..b81cdba957a 100644 --- a/docs/getting-started-guides/ubuntu_multinodes_cluster.md +++ b/docs/getting-started-guides/ubuntu_multinodes_cluster.md @@ -11,7 +11,7 @@ This document describes how to deploy kubernetes on multiple ubuntu nodes, inclu *3 These guide is tested OK on Ubuntu 14.04 LTS 64bit server, but it should also work on most Ubuntu versions* -*4 Dependences of this guide: etcd-2.0.0, flannel-0.2.0, k8s-0.10.1, but it should also work on higher versions* +*4 Dependences of this guide: etcd-2.0.0, flannel-0.2.0, k8s-0.12.0, but it may work with higher versions* ### **Main Steps** @@ -21,7 +21,7 @@ On your laptop, copy `cluster/ubuntu-cluster` directory to your workspace. The `build.sh` will download and build all the needed binaries into `./binaries`. -You can customize your etcd version or K8s version in the build.sh by changing variable `ETCD_V` and `K8S_V`, default etcd version is 2.0.0 and K8s version is 0.12.0. +You can customize your etcd version or K8s version in the build.sh by changing variable `ETCD_V` and `K8S_V` in build.sh, default etcd version is 2.0.0 and K8s version is 0.12.0. ```