From 0af31b5e508faa227a36e687346e7905a7a10ed6 Mon Sep 17 00:00:00 2001 From: Eric Multanen Date: Thu, 2 Jul 2020 15:34:13 -0700 Subject: Add terminate support to orchestrator and ncm Complete the basic terminate support for the orchestrator and ncm services. 1. When terminate REST API is invoked on a deployment intent group, call the uninstall grpc api to rsync and then remove the app context. 2. When terminate REST API is invoked on a cluster, add the uninstall grpc api call to rsync to remove the network resources from the clusters. Issue-ID: MULTICLOUD-1040 Signed-off-by: Eric Multanen Change-Id: I181e891a8c7c973970af061f9ff07d80c3bb64f9 --- kud/tests/README-composite-vfw.txt | 20 +++++++++++++------- kud/tests/vfw-test.sh | 18 +++++++++++++++--- 2 files changed, 28 insertions(+), 10 deletions(-) (limited to 'kud') diff --git a/kud/tests/README-composite-vfw.txt b/kud/tests/README-composite-vfw.txt index 3f334a25..d15c0352 100644 --- a/kud/tests/README-composite-vfw.txt +++ b/kud/tests/README-composite-vfw.txt @@ -127,18 +127,24 @@ The rest of the data needed for the test is present in the script. This will instantiate the vFW on the two edge clusters (as defined by the generic placement intent). +5. Status query -# Removing resources (until termination sequences are completed) + vfw-test.sh status -1. Run the cleanup script (or equivalent) in the edge clusters. - (once the terminate flow via EMCO is complete, this step will not be necessary) +6. Terminate + Terminate will remove the resources from the clusters and delete the internal + composite application information in the etcd base AppContext. + The script will do it for both the deployment intent group (i.e. the vfW composite + app) and the network intents. - bash cleanup-composite-vfw.sh - -2. Terminate the network intents + In principle, after runnin terminate, the 'apply' and 'instantiate' commands could + be invoked again to re-insantiate the networks and the vFW composite app. vfw-test.sh terminate -3. Delete everything from the Mongo DB +7. Delete the data + After running 'terminate', the 'delete' command can be invoked to remove all + the data created. This should leave the system back in the starting state - + begin with point #1 above to start again. vfw-test.sh delete diff --git a/kud/tests/vfw-test.sh b/kud/tests/vfw-test.sh index 9c431ef0..b14ad95b 100755 --- a/kud/tests/vfw-test.sh +++ b/kud/tests/vfw-test.sh @@ -958,12 +958,23 @@ function applyNcmData { call_api -d "{ }" "${base_url_ncm}/cluster-providers/${clusterprovidername}/clusters/${clustername2}/apply" } -# deletes the appcontext (eventually will terminate from resource synchronizer when that funcationality is ready) +# deletes the network resources from the clusters and the associated appcontext entries function terminateNcmData { call_api -d "{ }" "${base_url_ncm}/cluster-providers/${clusterprovidername}/clusters/${clustername}/terminate" call_api -d "{ }" "${base_url_ncm}/cluster-providers/${clusterprovidername}/clusters/${clustername2}/terminate" } +# terminates the vfw resources +function terminateOrchData { + call_api -d "{ }" "${base_url_orchestrator}/projects/${projectname}/composite-apps/${vfw_compositeapp_name}/${vfw_compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/terminate" +} + +# terminates the vfw and ncm resources +function terminateVfw { + terminateOrchData + terminateNcmData +} + function instantiateVfw { # call_api -d "{ }" "${base_url_orchestrator}/projects/${projectname}/composite-apps/${vfw_compositeapp_name}/${vfw_compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/approve" call_api -d "{ }" "${base_url_orchestrator}/projects/${projectname}/composite-apps/${vfw_compositeapp_name}/${vfw_compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/instantiate" @@ -990,13 +1001,14 @@ function usage { echo " apply - applys the network intents - e.g. networks created in ncm" echo " instantiate - approves and instantiates the composite app via the generic deployment intent" echo " status - get status of deployed resources" - echo " terminate - remove the network inents created by ncm" + echo " terminate - remove the vFW composite app resources and network resources create by 'instantiate' and 'apply'" echo "" echo " a reasonable test sequence:" echo " 1. create" echo " 2. apply" echo " 3. instantiate" echo " 4. status" + echo " 5. terminate" exit } @@ -1053,8 +1065,8 @@ case "$1" in "get" ) getData ;; "delete" ) deleteData ;; "apply" ) applyNcmData ;; - "terminate" ) terminateNcmData ;; "instantiate" ) instantiateVfw ;; + "terminate" ) terminateVfw ;; "status" ) statusVfw ;; *) usage ;; esac -- cgit 1.2.3-korg