3 ################################################################################
4 # Copyright (c) 2019 AT&T Intellectual Property. #
5 # Copyright (c) 2019 Nokia. #
7 # Licensed under the Apache License, Version 2.0 (the "License"); #
8 # you may not use this file except in compliance with the License. #
9 # You may obtain a copy of the License at #
11 # http://www.apache.org/licenses/LICENSE-2.0 #
13 # Unless required by applicable law or agreed to in writing, software #
14 # distributed under the License is distributed on an "AS IS" BASIS, #
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
16 # See the License for the specific language governing permissions and #
17 # limitations under the License. #
18 ################################################################################
20 if [ -z "$RICPLT_RELEASE_NAME" ] || [ -z "$RICPLT_COMPONENTS" ] || [ -z "$RICPLT_NAMESPACE" ]; then
21 echo "RICPLT_RELEASE_NAME or RICPLT_COMPONENTS or RICPLT_NAMESPACE unset, loading from ric_env.sh"
25 RICPLT_DEPLOYMENT="$RICPLT_RELEASE_NAME"
27 echo "Uninstall RIC Platform components $RICPLT_COMPONENTS"
28 echo "name space: $RICPLT_NAMESPACE, Helm release: $RICPLT_DEPLOYMENT"
30 echo "Removing Helm deploymentsi ..."
31 helm delete --purge "${RICPLT_RELEASE_NAME}"
32 helm delete --purge pre-"${RICPLT_RELEASE_NAME}"
33 find . -name "common-*" | xargs rm
37 #echo "Removing RIC resources from Kubernetes ..."
38 #RES=$(kubectl get pods -n "$RICPLT_NAMESPACE" |grep -v "tiller" |grep -v "RESTARTS" |grep -v "robot")
39 #while [ ! -z "$RES" ]; do
40 # NUMPODS=$(echo "$RES" | wc -l)
41 # echo "$(( NUMPODS - 1 )) pod(s) left, check again in 5 seconds ..."
43 # RES=$(kubectl get pods -n "$RICPLT_NAMESPACE" |grep -v "tiller" |grep -v "RESTARTS" |grep -v "robot")
45 #echo "All RIC resources are gone."
48 echo "It may take Kubernetes some time to release all resources created"
49 echo "for RIC Platform. Use \"kubectl get pods -n ricplatform\" to check."
50 echo "To truely clean up the helm state, run the following command:"
51 echo " ./helm_reset.sh"