Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reinit option to cleanup any existing ovs bridges #62

Merged
merged 1 commit into from Mar 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions install/k8s/contiv.yaml
Expand Up @@ -28,6 +28,7 @@ spec:
image: contiv/netplugin:__CONTIV_VERSION__
args:
- -pkubernetes
- -x
env:
- name: VLAN_IF
value: __VLAN_IF__
Expand Down
2 changes: 1 addition & 1 deletion install/k8s/install.sh
Expand Up @@ -245,7 +245,7 @@ cp ./netctl /usr/bin/
kubectl apply -f $contiv_yaml
if [ "$fwd_mode" = "routing" ]; then
sleep 60
./netctl --netmaster http://$netmaster:9999 global set --fwd-mode routing
netctl --netmaster http://$netmaster:9999 global set --fwd-mode routing
else
kubectl get deployment/kube-dns -n kube-system -o json > kube-dns.yaml
kubectl delete deployment/kube-dns -n kube-system
Expand Down
11 changes: 8 additions & 3 deletions install/k8s/uninstall.sh
Expand Up @@ -2,20 +2,25 @@

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
fi

# Delete the ACI secret if it is available
kubectl delete secret aci.key -n kube-system
kubectl delete secret aci.key -n kube-system || true

# 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

kubectl create -f install/k8s/cleanup.yaml
sleep 60
kubectl delete -f install/k8s/cleanup.yaml

# Re-creating the kube-dns deployment
kubectl create -f kube-dns.yaml
4 changes: 3 additions & 1 deletion scripts/build.sh
Expand Up @@ -8,7 +8,7 @@ VERSION=${BUILD_VERSION-$DEV_IMAGE_NAME}

auth_proxy_version=${CONTIV_API_PROXY_VERSION:-"1.0.0-beta.3"}
aci_gw_version=${CONTIV_ACI_GW_VERSION:-"latest"}
contiv_version=${CONTIV_VERSION:-"1.0.0-beta.3"}
contiv_version=${CONTIV_VERSION:-"1.0.0-beta.3-03-08-2017.18-51-20.UTC"}
etcd_version=${CONTIV_ETCD_VERSION:-2.3.7}
docker_version=${CONTIV_DOCKER_VERSION:-1.12.6}
ansible_image_version=${CONTIV_ANSIBLE_IMAGE_VERSION:-"1.0.0-beta.3.1"}
Expand Down Expand Up @@ -86,11 +86,13 @@ ansible_env=$ansible_yaml_dir/env.json

k8s_yaml_dir=$output_dir/install/k8s/
contiv_yaml=$k8s_yaml_dir/contiv.yaml
cleanup_yaml=$k8s_yaml_dir/cleanup.yaml
aci_gw_yaml=$k8s_yaml_dir/aci_gw.yaml
auth_proxy_yaml=$k8s_yaml_dir/auth_proxy.yaml
etcd_yaml=$k8s_yaml_dir/etcd.yaml

sed -i.bak "s/__CONTIV_VERSION__/$contiv_version/g" $contiv_yaml
sed -i.bak "s/__CONTIV_VERSION__/$contiv_version/g" $cleanup_yaml
sed -i.bak "s/__API_PROXY_VERSION__/$auth_proxy_version/g" $auth_proxy_yaml
sed -i.bak "s/__ACI_GW_VERSION__/$aci_gw_version/g" $aci_gw_yaml
sed -i.bak "s/__ETCD_VERSION__/$etcd_version/g" $etcd_yaml
Expand Down