-
Notifications
You must be signed in to change notification settings - Fork 31
/
ubuntu-multi-upgrade.sh
executable file
·29 lines (22 loc) · 1.12 KB
/
ubuntu-multi-upgrade.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash -e
# build latest pke tool
GOOS=linux make pke
KUBERNETES_VERSION="${1:-v1.23.3}"
# upgrade first master node
echo ""
echo "= ubuntu1 ========================================================================"
vagrant ssh ubuntu1 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION'"
# waiting 20 seconds because of apiserver
sleep 20
# upgrade second master node
echo ""
echo "= ubuntu2 ========================================================================"
vagrant ssh ubuntu2 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION' --kubernetes-additional-control-plane"
# upgrade third master node
echo ""
echo "= ubuntu3 ========================================================================"
vagrant ssh ubuntu3 -c "sudo /banzaicloud/pke upgrade master --kubernetes-version='$KUBERNETES_VERSION' --kubernetes-additional-control-plane"
# upgrade worker node
echo ""
echo "= ubuntu4 ========================================================================"
vagrant ssh ubuntu4 -c "sudo /banzaicloud/pke upgrade worker --kubernetes-version='$KUBERNETES_VERSION'"