mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 05:36:12 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user