BPA-RESTful_API uninstall script 37/1937/1
authorenyinna1234 <enyinna.ochulor@intel.com>
Thu, 7 Nov 2019 22:22:31 +0000 (14:22 -0800)
committerenyinna1234 <enyinna.ochulor@intel.com>
Thu, 7 Nov 2019 22:22:31 +0000 (14:22 -0800)
Adds an uninstall script that removes the BPA-RESTful-API
Kubernetes and docker components - roles, services, deployments,
serviceaacount, persistent volume (pv), pv claim, and images.

Signed-off-by: Enyinna Ochulor <enyinna.ochulor@intel.com>
Change-Id: Id60efa66887e59f5f8f867a0d1f04c5d9290f408

Makefile
cmd/bpa-restapi-agent/Makefile
cmd/bpa-restapi-agent/bpa_api_uninstall.sh [new file with mode: 0755]

index a0b4c86..fcb28f7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -61,6 +61,9 @@ bpa_op_all: bm_all bpa_op_install
 bpa_rest_api_install:
        pushd $(BPA_REST_API) && make deploy && popd
 
+bpa_rest_api_uninstall:
+       pushd $(BPA_REST_API) && make clean && popd
+
 bpa_rest_api_verifier:
        pushd $(BPA_REST_API) && make e2e_test && popd
 
index 3ca017f..6437dc3 100644 (file)
@@ -17,3 +17,6 @@ go_install:
 
 e2e_test: deploy
        ./e2e_test.sh
+
+clean:
+       ./bpa_api_uninstall.sh
diff --git a/cmd/bpa-restapi-agent/bpa_api_uninstall.sh b/cmd/bpa-restapi-agent/bpa_api_uninstall.sh
new file mode 100755 (executable)
index 0000000..f1f8836
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+ICN_DIR=$(dirname "$(dirname "$PWD")")
+
+kubectl delete -f service.yml
+
+pushd $ICN_DIR/deploy/kud-plugin-addons/minio/yaml
+
+./uninstall.sh
+
+popd
+
+kubectl delete -f bpa_api_cluster_role_binding.yml
+
+kubectl delete -f bpa_api_cluster_role.yml
+
+kubectl delete -f create-service-account.yml
+
+sleep 10
+
+sudo docker rmi akraino.org/icn/bpa-restapi-agent:latest
+
+sudo docker rmi mongo:latest
+
+sudo docker rmi minio/minio:latest