Skip to content

Commit

Permalink
add upgrade-ovs script (#1681)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Jul 13, 2022
1 parent f24ed68 commit 460f930
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions dist/images/upgrade-ovs.sh
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

0 comments on commit 460f930

Please sign in to comment.