-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f24ed68
commit 460f930
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
podNames=`kubectl get pod -n kube-system | grep ovs-ovn | awk '{print $1}'` | ||
for pod in $podNames | ||
do | ||
echo "upgrade pod $pod" | ||
kubectl delete pod -n kube-system $pod | ||
|
||
desireNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $2'}) | ||
currentNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $3'}) | ||
readyNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $4'}) | ||
availableNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $6'}) | ||
echo "daemonset ovs-ovn, desire $desireNum, current $currentNum, ready $readyNum, available $availableNum" | ||
while [ $desireNum != $currentNum ] || [ $desireNum != $readyNum ] || [ $desireNum != $availableNum ] | ||
do | ||
desireNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $2'}) | ||
currentNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $3'}) | ||
readyNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $4'}) | ||
availableNum=$(kubectl get daemonset -n kube-system | grep ovs-ovn | awk {'print $6'}) | ||
echo "ovs-ovn upgrade, desire $desireNum, current $currentNum, ready $readyNum, available $availableNum" | ||
sleep 1 | ||
done | ||
done |