Merge "Provide capability to specify release-name during instantiation"
[multicloud/k8s.git] / kud / tests / README-composite-vfw.txt
1 # Notes on running the composite vFW test case
2
3 # Infrastructure
4 As written, the vfw-test.sh script assumes 3 clusters
5 1 - the cluster in which the EMCO microservices are running
6 2 - two edge clusters in which the vFW will be instantiated
7
8 The edge cluster in which vFW will be instantiated should be KUD clusters.
9
10 # Edge cluster preparation
11
12 For status monitoring support, the 'monitor' docker image must be built and
13 deployed.
14
15 In multicloud-k8s repo:
16         cd multicloud-k8s/src/monitor
17         docker build -f build/Dockerfile . -t monitor
18         <tag and push docker image to dockerhub ...>
19
20 Deploy monitor program in each cluster (assumes multicloud-k8s repo is present in cloud)
21         # one time setup per cluster - install the CRD
22         cd multicloud-k8s/src/monitor/deploy
23         kubectl apply -f crds/k8splugin_v1alpha1_resourcebundlestate_crd.yaml
24         
25         # one time setup per cluster
26         # update yaml files with correct image
27         # (cleanup first, if monitor was already installed - see monitor-cleanup.sh)
28         cd multicloud-k8s/src/monitor/deploy
29         monitor-deploy.sh
30
31
32 # Preparation of the vFW Composit Application
33
34 ## Prepare the Composite vFW Application Charts and Profiles
35
36 1. In the multicloud-k8s/kud/demo/composite-firewall directory, prepare the 3 helm
37    charts for the vfw.
38
39    tar cvf packetgen.tar packetgen
40    tar cvf firewall.tar firewall
41    tar cvf sink.tar sink
42    gzip *.tar
43
44 2. Prepare the profile file (same one will be used for all profiles in this demo)
45
46    tar cvf profile.tar manifest.yaml override_values.yaml
47    gzip profile.tar
48
49 ## Set up environment variables for the vfw-test.sh script
50
51 The vfw-test.sh script expects a number of files to be provided via environment
52 variables.
53
54 Change directory to multicloud-k8s/kud/tests
55
56 1.  Edge cluster kubeconfig files - the script expects 2 of these
57
58     export kubeconfigfile=<path to first cluster kube config file>
59     export kubeconfigfile2=<path to second cluster kube config file>
60
61     for example:  export kubeconfigfile=/home/vagrant/multicloud-k8s/cluster-configs/config-edge01
62
63
64 2.  Composite app helm chart files (as prepared above)
65
66     export packetgen_helm_path=../demo/composite-firewall/packetgen.tar.gz
67     export firewall_helm_path=../demo/composite-firewall/firewall.tar.gz
68     export sink_helm_path=../demo/composite-firewall/sink.tar.gz
69
70 3.  Composite profile application profiles (as prepared above)
71
72     export packetgen_profile_targz=../demo/composite-firewall/profile.tar.gz
73     export firewall_profile_targz=../demo/composite-firewall/profile.tar.gz
74     export sink_profile_targz=../demo/composite-firewall/profile.tar.gz
75
76 4.  Modify the script to address the EMCO cluster
77
78     Modifiy the urls at the top part of the script to point to the
79     cluster IP address of the EMCO cluster.
80
81     That is, modify the IP address 10.10.10.6 to the correct value for
82     your environment.
83
84     Note also that the node ports used in the following are based on the values
85     defined in multicloud-k8s/deployments/kubernetes/onap4k8s.yaml
86
87         base_url_clm=${base_url_clm:-"http://10.10.10.6:31856/v2"}
88         base_url_ncm=${base_url_ncm:-"http://10.10.10.6:32737/v2"}
89         base_url_orchestrator=${base_url_orchestrator:-"http://10.10.10.6:31298/v2"}
90         base_url_ovnaction=${base_url_ovnaction:-"http://10.10.10.6:31181/v2"}
91
92
93 # Run the vfw-test.sh
94
95 The rest of the data needed for the test is present in the script.
96
97 1.  Invoke API calls to create the data
98     
99     vfw-test.sh create
100
101     This does all of the data setup
102     - registers clusters
103     - registers controllers
104     - sets up the composite app and profile
105     - sets up all of the intents
106
107 2.  Query results (optional)
108
109     vfw-test.sh get
110
111 3.  Apply the network intents
112
113     For the vFW test, the 3 networks used by the vFW are created by using network intents.
114     Both virtual and provider networks are used.
115
116     vfw-test.sh apply
117
118     On the edge clusters, check to see the networks were created:
119
120     kubectl get network
121     kubectl get providernetwork
122
123 4.  Instantiate the vFW
124
125     vfw-test.sh instantiate
126
127     This will instantiate the vFW on the two edge clusters (as defined by the generic
128     placement intent).
129
130 5. Status query
131
132    vfw-test.sh status
133
134 6. Terminate
135    Terminate will remove the resources from the clusters and delete the internal
136    composite application information in the etcd base AppContext.
137    The script will do it for both the deployment intent group (i.e. the vfW composite
138    app) and the network intents.
139
140    In principle, after runnin terminate, the 'apply' and 'instantiate' commands could
141    be invoked again to re-insantiate the networks and the vFW composite app.
142
143    vfw-test.sh terminate
144
145 7. Delete the data
146    After running 'terminate', the 'delete' command can be invoked to remove all
147    the data created.  This should leave the system back in the starting state -
148    begin with point #1 above to start again.
149
150    vfw-test.sh delete