diff options
Diffstat (limited to 'kud')
-rw-r--r-- | kud/tests/README-composite-vfw.txt | 44 | ||||
-rw-r--r-- | kud/tests/cleanup-composite-vfw.sh | 21 | ||||
-rwxr-xr-x[-rw-r--r--] | kud/tests/vfw-test-clean-cluster.sh | 11 | ||||
-rwxr-xr-x | kud/tests/vfw-test.sh | 24 |
4 files changed, 68 insertions, 32 deletions
diff --git a/kud/tests/README-composite-vfw.txt b/kud/tests/README-composite-vfw.txt index d2018c09..d15c0352 100644 --- a/kud/tests/README-composite-vfw.txt +++ b/kud/tests/README-composite-vfw.txt @@ -7,7 +7,29 @@ As written, the vfw-test.sh script assumes 3 clusters The edge cluster in which vFW will be instantiated should be KUD clusters. -# Preparations +# Edge cluster preparation + +For status monitoring support, the 'monitor' docker image must be built and +deployed. + +In multicloud-k8s repo: + cd multicloud-k8s/src/monitor + docker build -f build/Dockerfile . -t monitor + <tag and push docker image to dockerhub ...> + +Deploy monitor program in each cluster (assumes multicloud-k8s repo is present in cloud) + # one time setup per cluster - install the CRD + cd multicloud-k8s/src/monitor/deploy/crds + kubectl apply -f crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml + + # one time setup per cluster + # update yaml files with correct image + # (cleanup first, if monitor was already installed - see monitor-cleanup.sh) + cd multicloud-k8s/src/monitor/deploy + monitor-deploy.sh + + +# Preparation of the vFW Composit Application ## Prepare the Composite vFW Application Charts and Profiles @@ -105,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) - -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) + vfw-test.sh status - bash cleanup-composite-vfw.sh +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. -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/cleanup-composite-vfw.sh b/kud/tests/cleanup-composite-vfw.sh deleted file mode 100644 index 7f96e8ac..00000000 --- a/kud/tests/cleanup-composite-vfw.sh +++ /dev/null @@ -1,21 +0,0 @@ -# To clean up composite vfw demo resources in a cluster -kubectl -n onap4k8s delete deployment clm -kubectl -n onap4k8s delete deployment orchestrator -kubectl -n onap4k8s delete deployment ncm -kubectl -n onap4k8s delete deployment ovnaction -kubectl -n onap4k8s delete deployment rsync -kubectl -n onap4k8s delete service clm -kubectl -n onap4k8s delete service orchestrator -kubectl -n onap4k8s delete service ncm -kubectl -n onap4k8s delete service ovnaction -kubectl -n onap4k8s delete service rsync -kubectl -n onap4k8s delete configmap clm -kubectl -n onap4k8s delete configmap orchestrator -kubectl -n onap4k8s delete configmap ncm -kubectl -n onap4k8s delete configmap ovnaction -kubectl -n onap4k8s delete configmap rsync - -# delete the networks -kubectl delete network protected-private-net -kubectl delete providernetwork emco-private-net -kubectl delete providernetwork unprotected-private-net diff --git a/kud/tests/vfw-test-clean-cluster.sh b/kud/tests/vfw-test-clean-cluster.sh index 3d386466..153924ca 100644..100755 --- a/kud/tests/vfw-test-clean-cluster.sh +++ b/kud/tests/vfw-test-clean-cluster.sh @@ -1,6 +1,17 @@ +#!/bin/bash + +# script to delete vfw resources (until terminate is completed) kubectl delete deploy fw0-packetgen kubectl delete deploy fw0-firewall kubectl delete deploy fw0-sink kubectl delete service packetgen-service kubectl delete service sink-service kubectl delete configmap sink-configmap + +kubectl delete network protected-private-net +kubectl delete providernetwork emco-private-net +kubectl delete providernetwork unprotected-private-net + +for i in `kubectl get resourcebundlestate --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'`; do + kubectl delete resourcebundlestate $i +done diff --git a/kud/tests/vfw-test.sh b/kud/tests/vfw-test.sh index 2bdddcd7..b14ad95b 100755 --- a/kud/tests/vfw-test.sh +++ b/kud/tests/vfw-test.sh @@ -958,17 +958,31 @@ 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" } +function statusVfw { + call_api "${base_url_orchestrator}/projects/${projectname}/composite-apps/${vfw_compositeapp_name}/${vfw_compositeapp_version}/deployment-intent-groups/${deployment_intent_group_name}/status" +} function usage { echo "Usage: $0 create|get|delete|apply|terminate|instantiate" @@ -986,12 +1000,15 @@ function usage { echo " delete - deletes all resources in ncm, ovnaction, clm resources created for vfw" 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 " terminate - remove the network inents created by ncm" + echo " status - get status of deployed resources" + 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 } @@ -1048,7 +1065,8 @@ case "$1" in "get" ) getData ;; "delete" ) deleteData ;; "apply" ) applyNcmData ;; - "terminate" ) terminateNcmData ;; "instantiate" ) instantiateVfw ;; + "terminate" ) terminateVfw ;; + "status" ) statusVfw ;; *) usage ;; esac |