Skip to content

Commit

Permalink
Restart netplugin after netmaster when changing routing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
neelimamukiri committed Jul 21, 2017
1 parent cfb7056 commit 1eb419a
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions install/k8s/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -280,25 +280,41 @@ $kubectl apply -f $contiv_yaml
set +e
for i in {0..150}; do
sleep 2
# check contiv pods
$kubectl get pods -n kube-system | grep -v "Running" | grep -q ^contiv && continue
# check netplugin status
curl -s localhost:9090/inspect/driver | grep -wq FwdMode || continue
# check contiv netmaster pods
$kubectl get pods -n kube-system | grep -v "Running" | grep -q ^contiv-netmaster && continue
# check that netmaster is available
netctl tenant ls >/dev/null 2>&1 || continue
break
done

[[ $i -ge 150 ]] && error_ret "contiv pods are not ready !!"
[[ $i -ge 150 ]] && error_ret "contiv netmaster is not ready !!"

set -e

if [ "$fwd_mode" == "routing" ]; then
netctl global set --fwd-mode $fwd_mode || true
sleep 5 # for re-init to complete

netctl net ls -q | grep -q -w "contivh1" || netctl net create -n infra -s $infra_subnet -g $infra_gateway contivh1

# Restart netplugin to allow fwdMode change
$kubectl -n kube-system delete daemonset contiv-netplugin
$kubectl apply -f $contiv_yaml
fi

set +e
for i in {0..150}; do
sleep 2
# check contiv pods
$kubectl get pods -n kube-system | grep -v "Running" | grep -q ^contiv && continue
# check netplugin status
curl -s localhost:9090/inspect/driver | grep -wq FwdMode || continue
break
done

[[ $i -ge 150 ]] && error_ret "contiv pods are not ready !!"

set -e


echo "Installation is complete"
echo "========================================================="
echo " "
Expand Down

0 comments on commit 1eb419a

Please sign in to comment.