From 6846770643a4e8fe4d7b8a7267599db68f282a63 Mon Sep 17 00:00:00 2001 From: Neelima Mukiri Date: Tue, 7 Mar 2017 11:22:01 -0800 Subject: [PATCH] Add reinit option to cleanup any existing ovs bridges Fixes https://github.com/contiv/install/issues/61 --- install/k8s/contiv.yaml | 1 + install/k8s/uninstall.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install/k8s/contiv.yaml b/install/k8s/contiv.yaml index 886f844..7066509 100644 --- a/install/k8s/contiv.yaml +++ b/install/k8s/contiv.yaml @@ -28,6 +28,7 @@ spec: image: contiv/netplugin:__CONTIV_VERSION__ args: - -pkubernetes + - -x env: - name: VLAN_IF value: __VLAN_IF__ diff --git a/install/k8s/uninstall.sh b/install/k8s/uninstall.sh index 9c1d19c..6b6b6cb 100755 --- a/install/k8s/uninstall.sh +++ b/install/k8s/uninstall.sh @@ -2,7 +2,7 @@ set -euo pipefail -if [ "$1" = "-h" ]; then +if [ "$#" -eq 1 ] && [ "$1" = "-h" ]; then echo "Usage: ./install/k8s/uninstall.sh to uninstall contiv" echo " ./install/k8s/uninstall.sh etcd-cleanup to uninstall contiv and cleanup contiv data" exit 1 @@ -13,9 +13,14 @@ kubectl delete secret aci.key -n kube-system # Delete Contiv pods kubectl delete -f .contiv.yaml -if [ "$1" = "etcd-cleanup" ]; then +if [ "$#" -eq 1 ] && [ "$1" = "etcd-cleanup" ]; then rm -rf /var/etcd/contiv-data fi # Re-creating the kube-dns deployment kubectl create -f kube-dns.yaml + +set -x +for p in $(ifconfig | grep vport | awk '{print $1}'); do + ip link delete $p type veth; +done