blob: e274e0d0c598421ae8f25f337f7cfaf0ebc8f618 [file] [log] [blame]
beili.zhouab1c1ab2017-12-07 12:05:06 -05001########################################################################################
2# This script wraps {$OOM}/kubernetes/oneclick/deleteAll.sh script along with #
3# the following steps to clean up ONAP configure for specified namespace: #
4# - remove namespace #
5# - remove release #
6# - remove shared directory #
7# #
8# To run it, just enter the following command: #
9# ./autoCleanConfig.bash <namespace, default is "onap"> #
10########################################################################################
11#!/bin/bash
12
13
14NS=$1
15if [[ -z $NS ]]
16then
17 echo "Namespace is not specified, use onap namespace."
18 NS="onap"
19fi
20
21echo "Clean up $NS configuration"
22cd ..
23./deleteAll.bash -n $NS -y
24cd -
25
26echo "----------------------------------------------
27Force remove namespace..."
28kubectl delete namespace $NS
29echo "...done : kubectl get namespace
30-----------------------------------------------
31>>>>>>>>>>>>>> k8s namespace"
32kubectl get namespace
33while [[ ! -z `kubectl get namespace|grep $NS` ]]
34do
35 echo "Wait for namespace $NS to be deleted
36-----------------------------------------------
37>>>>>>>>>>>>>> k8s namespace"
38 kubectl get namespace
39 sleep 2
40done
41
42echo "Force delete helm process ..."
43helm delete $NS-config --purge --debug
44echo "...done : helm ls --all
45 -----------------------------------------------
46>>>>>>>>>>>>>> helm"
47helm ls --all
48
49echo "Remove $NS dockerdata..."
50sudo rm -rf /dockerdata-nfs/onap
51echo "...done : ls -altr /dockerdata-nfs
52 -----------------------------------------------
53>>>>>>>>>>>>>> /dockerdata-nfs directory"
54ls -altr /dockerdata-nfs