From bb28684f43822bf9efd0e5c85ba9343c7be48c6b Mon Sep 17 00:00:00 2001 From: Jian Huang Date: Fri, 31 Jul 2015 17:25:13 +0800 Subject: [PATCH 1/2] Update util.sh When we deploy the kubernetes using Ubuntu's script. 1. First we set the roles "ai i i" and NUM_MINIONS=3, it runs as expected. 2. Then we change the roles to "a i i" and NUM_MINIONS=2, we found it will not run successfully. It's because there are history files left on the previous deployment. This commit will delete the files when stop the cluster. --- cluster/ubuntu/util.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cluster/ubuntu/util.sh b/cluster/ubuntu/util.sh index d04cd0c02e4..066bca0518d 100755 --- a/cluster/ubuntu/util.sh +++ b/cluster/ubuntu/util.sh @@ -437,6 +437,8 @@ function kube-down { { echo "Cleaning on node ${i#*@}" ssh -t $i 'pgrep etcd && sudo -p "[sudo] password for cleaning etcd data: " service etcd stop && sudo rm -rf /infra*' + # Delete the files in order to generate a clean environment, so you can change each node's role at next deployment. + ssh -t $i 'rm -f /opt/bin/kube* /etc/init/kube* /etc/init.d/kube* /etc/default/kube*; rm -rf ~/kube' } done wait From 7b5a6e906e601adfa76914d41fbcdf68d45b1b33 Mon Sep 17 00:00:00 2001 From: Jian Huang Date: Thu, 6 Aug 2015 21:16:13 +0800 Subject: [PATCH 2/2] Remove kubelet files for a clean teardown Remove /var/lib/kubelet folder in order to gain a more clean environment --- cluster/ubuntu/util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/ubuntu/util.sh b/cluster/ubuntu/util.sh index 066bca0518d..b9766495199 100755 --- a/cluster/ubuntu/util.sh +++ b/cluster/ubuntu/util.sh @@ -438,7 +438,7 @@ function kube-down { echo "Cleaning on node ${i#*@}" ssh -t $i 'pgrep etcd && sudo -p "[sudo] password for cleaning etcd data: " service etcd stop && sudo rm -rf /infra*' # Delete the files in order to generate a clean environment, so you can change each node's role at next deployment. - ssh -t $i 'rm -f /opt/bin/kube* /etc/init/kube* /etc/init.d/kube* /etc/default/kube*; rm -rf ~/kube' + ssh -t $i 'rm -f /opt/bin/kube* /etc/init/kube* /etc/init.d/kube* /etc/default/kube*; rm -rf ~/kube /var/lib/kubelet' } done wait