blob: 0bff65c1c694e0c8df40cf1b87f31bef501048c2 [file] [log] [blame]
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2020 ONAP
4
5.. _docs_vFW_CNF_CDS:
6
7.. contents::
8 :depth: 4
9..
10
11vFirewall CNF Use Case
12----------------------
13
Konrad Bańkacc67f632020-03-12 12:09:13 +010014#FIXME - update all pod names
15
Samuli Silviusa58b0b42020-02-18 10:00:47 +020016Source files
17~~~~~~~~~~~~
18- Heat/Helm/CDS models: `vFW_CNF_CDS Model`_
19
20Description
21~~~~~~~~~~~
22This use case is a combination of `vFW CDS Dublin`_ and `vFW EDGEX K8S`_ use cases. The aim is to continue improving Kubernetes based Network Functions (a.k.a CNF) support in ONAP. Use case continues where `vFW EDGEX K8S`_ left and brings CDS support into picture like `vFW CDS Dublin`_ did for the old vFW Use case. Predecessor use case is also documented here `vFW EDGEX K8S In ONAP Wiki`_.
23
Konrad Bańkacc67f632020-03-12 12:09:13 +010024In a higher level this use case brings only two improvements yet important ones i.e. the ability to instantiate more than single CNF instance of same type (with same Helm package) and ability to embed into singular CSAR package more than one helm package what brings more service design options.
Samuli Silviusa58b0b42020-02-18 10:00:47 +020025
Konrad Bańkacc67f632020-03-12 12:09:13 +010026Following improvements were made in the Use Case or related ONAP components:
Samuli Silviusa58b0b42020-02-18 10:00:47 +020027
Konrad Bańkacc67f632020-03-12 12:09:13 +010028- Changed vFW Kubernetes Helm charts to support overrides (previously mostly hardcoded values)
Samuli Silviusa58b0b42020-02-18 10:00:47 +020029- Combined all models (Heat, Helm, CBA) in to same git repo and a creating single CSAR package `vFW_CNF_CDS Model`_
Konrad Bańkacc67f632020-03-12 12:09:13 +010030- Compared to `vFW EDGEX K8S`_ use case **MACRO** workflow in SO is used instead of VNF a'la carte workflow. (this is general requirement to utilize CDS as part of instantiation flow)
31- SDC accepts Onboarding Package with many helm packages what allows to keep decomposition of service instance similar to `vFW CDS Dublin`
32- CDS is used to resolve instantiation time parameters (Helm override)
Samuli Silviusa58b0b42020-02-18 10:00:47 +020033 - Ip addresses with IPAM
34 - Unique names for resources with ONAP naming service
35- Multicloud/k8s plugin changed to support identifiers of vf-module concept
Konrad Bańkacc67f632020-03-12 12:09:13 +010036- **multicloud/k8s profile** is not mandatory for instantiation of CNF
Samuli Silviusa58b0b42020-02-18 10:00:47 +020037- CDS is used to create **multicloud/k8s profile** as part of instantiation flow (previously manual step)
38
39Use case does not contain Closed Loop part of the vFW demo.
40
41The vFW CNF Use Case
42~~~~~~~~~~~~~~~~~~~~
Konrad Bańkacc67f632020-03-12 12:09:13 +010043The vFW CNF CDS use case shows how to instantiate multiple CNF instances in similar way as VNFs bringing CNFs closer to first class citizens in ONAP.
Samuli Silviusa58b0b42020-02-18 10:00:47 +020044
Konrad Bańkacc67f632020-03-12 12:09:13 +010045One of the biggest practical change compared to the old demos (any ONAP demo) is that whole network function content (user provided content) is collected to one place and more importantly into git repository (`vFW_CNF_CDS Model`_) that provides version control (that is pretty important thing). That is very basic thing but unfortunately this is a common problem when running any ONAP demo and trying to find all content from many different git repositories and even some files only in ONAP wiki.
Samuli Silviusa58b0b42020-02-18 10:00:47 +020046
47Demo git directory has also `Data Dictionary`_ file (CDS model time resource) included.
48
49Another founding idea from the start was to provide complete content in single CSAR available directly from that git repository. Not any revolutionary idea as that's the official package format ONAP supports and all content supposed to be in that same package for single service regardless of the models and closed loops and configurations etc.
50
Konrad Bańkacc67f632020-03-12 12:09:13 +010051Following table describes all the source models to which this demo is based on.
Samuli Silviusa58b0b42020-02-18 10:00:47 +020052
53=============== ================= ===========
54Model Git reference Description
55--------------- ----------------- -----------
Konrad Bańkacc67f632020-03-12 12:09:13 +010056Heat `vFW_NextGen`_ Heat templates used in original vFW demo but split into multiple vf-modules
Samuli Silviusa58b0b42020-02-18 10:00:47 +020057Helm `vFW_Helm Model`_ Helm templates used in `vFW EDGEX K8S`_ demo
58CDS model `vFW CBA Model`_ CDS CBA model used in `vFW CDS Dublin`_ demo
59=============== ================= ===========
60
Konrad Bańkacc67f632020-03-12 12:09:13 +010061All changes to related ONAP components and Use Case can be found from this `Jira Epic`_ ticket.
Samuli Silviusa58b0b42020-02-18 10:00:47 +020062
63Modeling CSAR/Helm
64..................
65
Konrad Bańkacc67f632020-03-12 12:09:13 +010066The starting point for this demo was Helm package containing one Kubernetes application, see `vFW_Helm Model`_. In this demo we decided to follow SDC/SO vf-module concept the same way as original vFW demo was split into multiple vf-modules instead of one (`vFW_NextGen`_). The same way we splitted Helm version of vFW into multiple Helm packages each matching one dedicated vf-module.
Samuli Silviusa58b0b42020-02-18 10:00:47 +020067
Konrad Bańkacc67f632020-03-12 12:09:13 +010068Produced CSAR package has following MANIFEST file (csar/MANIFEST.json) having all Helm packages modeled as dummy Heat resources matching to vf-module concept (that is originated from Heat), so basically each Helm application is visible to ONAP as own vf-module. Actual Helm package is delivered as CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT package through SDC and SO. Dummy heat templates are matched to helm packages by the same prefix of the file name.
Samuli Silviusa58b0b42020-02-18 10:00:47 +020069
70CDS model (CBA package) is delivered as SDC supported own type CONTROLLER_BLUEPRINT_ARCHIVE.
71
72::
73
74 {
75 "name": "virtualFirewall",
76 "description": "",
77 "data": [
78 {
79 "file": "vFW_CDS_CNF.zip",
80 "type": "CONTROLLER_BLUEPRINT_ARCHIVE"
81 },
82 {
83 "file": "base_template.yaml",
84 "type": "HEAT",
85 "isBase": "true",
86 "data": [
87 {
88 "file": "base_template.env",
89 "type": "HEAT_ENV"
90 }
91 ]
92 },
93 {
94 "file": "base_template_cloudtech_k8s_charts.tgz",
Konrad Bańkacc67f632020-03-12 12:09:13 +010095 "type": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"
Samuli Silviusa58b0b42020-02-18 10:00:47 +020096 },
97 {
98 "file": "vfw.yaml",
99 "type": "HEAT",
100 "isBase": "false",
101 "data": [
102 {
103 "file": "vfw.env",
104 "type": "HEAT_ENV"
105 }
106 ]
107 },
108 {
109 "file": "vfw_cloudtech_k8s_charts.tgz",
Konrad Bańkacc67f632020-03-12 12:09:13 +0100110 "type": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200111 },
112 {
113 "file": "vpkg.yaml",
114 "type": "HEAT",
115 "isBase": "false",
116 "data": [
117 {
118 "file": "vpkg.env",
119 "type": "HEAT_ENV"
120 }
121 ]
122 },
123 {
124 "file": "vpkg_cloudtech_k8s_charts.tgz",
Konrad Bańkacc67f632020-03-12 12:09:13 +0100125 "type": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200126 },
127 {
128 "file": "vsn.yaml",
129 "type": "HEAT",
130 "isBase": "false",
131 "data": [
132 {
133 "file": "vsn.env",
134 "type": "HEAT_ENV"
135 }
136 ]
137 },
138 {
139 "file": "vsn_cloudtech_k8s_charts.tgz",
Konrad Bańkacc67f632020-03-12 12:09:13 +0100140 "type": "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200141 }
142 ]
143 }
144
145Multicloud/k8s
146..............
147
148K8s plugin was changed to support new way to identify k8s application and related multicloud/k8s profile.
149
150Changes done:
151
152- SDC distribution broker
153
Konrad Bańkacc67f632020-03-12 12:09:13 +0100154 SDC distribution broker is responsible for transformation of the CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACTS into *Definition* object holding the helm package. The change for Frankfurt release considers that singular CSAR package can have many CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACTS, each one for dedicated vf-module associated with dummy heat template. The mapping between vf-module and CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACTS is done on file prefixes. In example, *vfw.yaml* Heat template will result with creation of *vfw* vf-module and its Definition will be created from CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACTS file of name vfw_cloudtech_k8s_charts.tgz. More examples can be found in `Modeling CSAR/Helm`_ section.
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200155
156- K8S plugin APIs changed to use VF Module Model Identifiers
157
158 Previously K8S plugin's used user given values in to identify object created/modified. Names were basing on VF-Module's "model-name"/"model-version" like "VfwLetsHopeLastOne..vfw..module-3" and "1". SO request has user_directives from where values was taken.
159
160 **VF Module Model Invariant ID** and **VF Module Model Version ID** is now used to identify artifact in SO request to Multicloud/k8s plugin. This does not require user to give extra parameters for the SO request as vf-module related parameters are there already by default. `MULTICLOUD-941`_
161 Note that API endpoints are not changed but only the semantics.
162
163 *Examples:*
164
165 Definition
166
167 ::
168
169 /api/multicloud-k8s/v1/v1/rb/definition/{VF Module Model Invariant ID}/{VF Module Model Version ID}/content
170
171
172 Profile creation API
173
174 ::
175
176 curl -i -d @create_rbprofile.json -X POST http://${K8S_NODE_IP}:30280/api/multicloud-k8s/v1/v1/rb/definition/{VF Module Model Invariant ID}/{VF Module Model Version ID}/profile
177 { "rb-name": “{VF Module Model Invariant ID}",
178 "rb-version": "{VF Module Model Version ID}",
179 "profile-name": "p1",
180 "release-name": "r1",
181 "namespace": "testns1",
182 "kubernetes-version": "1.13.5"
183 }
184
185 Upload Profile content API
186
187 ::
188
189 curl -i --data-binary @profile.tar.gz -X POST http://${K8S_NODE_IP}:30280/api/multicloud-k8s/v1/v1/rb/definition/{VF Module Model Invariant ID}/{VF Module Model Version ID}/profile/p1/content
190
Konrad Bańkacc67f632020-03-12 12:09:13 +0100191- Instantiation broker
192
193 The broker implements `infra_workload`_ API used to handle vf-module instantiation request comming from the SO. User directives were changed by SDNC directives what impacts also the way how a'la carte instantiation method works from the VID. There is no need to specify the user directives delivered from the separate file. Instead SDNC directives are delivered through SDNC preloading (a'la carte instantiation) or through the resource assignment performed by the CDS (Macro flow instantiation).
194
195
196 For helm package instantiation following parameters have to be delivered in the SDNC directives:
197
198
199 ======================== ==============================================
200
201 Variable Description
202
203 ------------------------ ----------------------------------------------
204
205 k8s-rb-profile-name Name of the override profile
206
207 k8s-rb-profile-namespace Name of the namespace for created helm package
208
209 ======================== ==============================================
210
211- Default override support was added to the plugin
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200212
213 **TODO: Some content here, maybe also picture**
214
Konrad Bańkacc67f632020-03-12 12:09:13 +0100215- Instantiation time override support was added to the plugin
216
217 **TODO: Some content here, maybe also picture**
218
219
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200220CDS Model (CBA)
221...............
222
223Creating CDS model was the core of the use case work and also the most difficult and time consuming part. There are many reasons for this e.g.
224
225- CDS documentation (even being new component) is inadequate or non-existent for service modeler user. One would need to be CDS developer to be able to do something with it.
226- CDS documentation what exists is non-versioned (in ONAP wiki when should be in git) so it's mostly impossible to know what features are for what release.
227- Our little experience of CDS (not CDS developers)
228
229At first the target was to keep CDS model as close as possible to `vFW_CNF_CDS Model`_ use case model and only add smallest possible changes to enable also k8s usage. That is still the target but in practice model deviated from the original one already and time pressure pushed us to not care about sync. Basically the end result could be possible much streamlined if wanted to be smallest possible to working only for K8S based network functions.
230
231As K8S application was splitted into multiple Helm packages to match vf-modules, CBA modeling follows the same and for each vf-module there's own template in CBA package.
232
233::
234
235 "artifacts" : {
236 "base_template-template" : {
237 "type" : "artifact-template-velocity",
238 "file" : "Templates/base_template-template.vtl"
239 },
240 "base_template-mapping" : {
241 "type" : "artifact-mapping-resource",
242 "file" : "Templates/base_template-mapping.json"
243 },
244 "vpkg-template" : {
245 "type" : "artifact-template-velocity",
246 "file" : "Templates/vpkg-template.vtl"
247 },
248 "vpkg-mapping" : {
249 "type" : "artifact-mapping-resource",
250 "file" : "Templates/vpkg-mapping.json"
251 },
252 "vfw-template" : {
253 "type" : "artifact-template-velocity",
254 "file" : "Templates/vfw-template.vtl"
255 },
256 "vfw-mapping" : {
257 "type" : "artifact-mapping-resource",
258 "file" : "Templates/vfw-mapping.json"
259 },
260 "vnf-template" : {
261 "type" : "artifact-template-velocity",
262 "file" : "Templates/vnf-template.vtl"
263 },
264 "vnf-mapping" : {
265 "type" : "artifact-mapping-resource",
266 "file" : "Templates/vnf-mapping.json"
267 },
268 "vsn-template" : {
269 "type" : "artifact-template-velocity",
270 "file" : "Templates/vsn-template.vtl"
271 },
272 "vsn-mapping" : {
273 "type" : "artifact-mapping-resource",
274 "file" : "Templates/vsn-mapping.json"
275 }
276 }
277
278Only **resource-assignment** workflow of the CBA model is utilized in this demo. If final CBA model contains also **config-deploy** workflow it's there just to keep parity with original vFW CBA (for VMs). Same applies for the related template *Templates/nf-params-template.vtl* and it's mapping file.
279
280The interesting part on CBA model is the **profile-upload** sub step of imperative workflow where Kotlin script is used to upload K8S profile into multicloud/k8s API.
281
282::
283
284 "profile-upload" : {
285 "type" : "component-script-executor",
286 "interfaces" : {
287 "ComponentScriptExecutor" : {
288 "operations" : {
289 "process" : {
290 "inputs" : {
291 "script-type" : "kotlin",
292 "script-class-reference" : "org.onap.ccsdk.cds.blueprintsprocessor.services.execution.scripts.K8sProfileUpload",
293 "dynamic-properties" : "*profile-upload-properties"
294 }
295 }
296 }
297 }
298 }
299 }
300
301Kotlin script expects that K8S profile package named like "k8s-rb-profile-name".tar.gz is present in CBA "Templates/k8s-profiles directory" where "k8s-rb-profile-name" is one of the CDS resolved parameters (user provides as input parameter).
302
303**TODO: something about the content and structure of profile package**
304
305As `Data Dictionary`_ is also included into demo git directory, re-modeling and making changes into model utilizing CDS model time / runtime is easier as used DD is also known.
306
307UAT
308+++
309
310During testing of the use case **uat.yml** file was recorded according to `CDS UAT Testing`_ instructions. Generated uat.yml is stored within CBA package into **Tests** folder.
311
312Recorded uat.yml is an example run with example values (the values we used when demo was run) and can be used later to test CBA model in isolation (unit test style). This is very useful when changes are made to CBA model and those changes are needed to be tested fast. With uat.yml file only CDS is needed as all external interfaces are mocked. However, note that mocking is possible for REST interfaces only (e.g. Netconf is not supported).
313
314Another benefit of uat.yml is that it documents the runtime functionality of the CBA.
315
316To verify CBA with uat.yaml and CDS runtime do following:
317
318- Enable UAT testing for CDS runtime
319
320 ::
321
322 kubectl -n onap edit deployment onap-cds-cds-blueprints-processor
323
324 # add env variable for cds-blueprints-processor container:
325 name: spring_profiles_active
326 value: uat
327
328- Spy CBA functionality with UAT initial seed file
329
330::
331
332 curl -X POST -u ccsdkapps:ccsdkapps -F cba=@my_cba.zip -F uat=@input_uat.yaml http://<kube-node>:30499/api/v1/uat/spy
333
334where my_cba.zip is the original cba model and input_uat.yml is following in this use case:
335
336::
337
338 %YAML 1.1
339 ---
340 processes:
341 - name: resource-assignment for vnf
342 request:
343 commonHeader: &commonHeader
344 originatorId: SDNC_DG
345 requestId: "98397f54-fa57-485f-a04e-1e220b7b1779"
346 subRequestId: "6bfca5dc-993d-48f1-ad27-a7a9ea91836b"
347 actionIdentifiers: &actionIdentifiers
348 blueprintName: vFW_CNF_CDS
349 blueprintVersion: "1.0.7"
350 actionName: resource-assignment
351 mode: sync
352 payload:
353 resource-assignment-request:
354 template-prefix:
355 - "vnf"
356 resource-assignment-properties:
357 service-instance-id: &service-id "0362acff-38e7-4ecc-8ac0-4780161f3ca0"
358 vnf-model-customization-uuid: &vnf-model-cust-uuid "366c007e-7684-4a0b-a2f4-9815174bec55"
359 vnf-id: &vnf-id "6bfca5dc-993d-48f1-ad27-a7a9ea91836b"
360 aic-cloud-region: &cloud-region "k8sregionfour"
361 - name: resource-assignment for base_template
362 request:
363 commonHeader: *commonHeader
364 actionIdentifiers: *actionIdentifiers
365 payload:
366 resource-assignment-request:
367 template-prefix:
368 - "base_template"
369 resource-assignment-properties:
370 nfc-naming-code: "base_template"
371 k8s-rb-profile-name: &k8s-profile-name "vfw-cnf-cds-base-profile"
372 service-instance-id: *service-id
373 vnf-id: *vnf-id
374 vf-module-model-customization-uuid: "603eadfe-50d6-413a-853c-46f5a8e2ddc7"
375 vnf-model-customization-uuid: *vnf-model-cust-uuid
376 vf-module-id: "34c190c7-e5bc-4e61-a0d9-5fd44416dd96"
377 aic-cloud-region: *cloud-region
378 - name: resource-assignment for vpkg
379 request:
380 commonHeader: *commonHeader
381 actionIdentifiers: *actionIdentifiers
382 payload:
383 resource-assignment-request:
384 template-prefix:
385 - "vpkg"
386 resource-assignment-properties:
387 nfc-naming-code: "vpkg"
388 k8s-rb-profile-name: *k8s-profile-name
389 service-instance-id: *service-id
390 vnf-id: *vnf-id
391 vf-module-model-customization-uuid: "32ffad03-d38d-46d5-b4a6-a3b0b6112ffc"
392 vnf-model-customization-uuid: *vnf-model-cust-uuid
393 vf-module-id: "0b3c70f3-a462-4340-b08f-e39f6baa364e"
394 aic-cloud-region: *cloud-region
395 - name: resource-assignment for vsn
396 request:
397 commonHeader: *commonHeader
398 actionIdentifiers: *actionIdentifiers
399 payload:
400 resource-assignment-request:
401 template-prefix:
402 - "vsn"
403 resource-assignment-properties:
404 nfc-naming-code: "vsn"
405 k8s-rb-profile-name: *k8s-profile-name
406 service-instance-id: *service-id
407 vnf-id: *vnf-id
408 vf-module-model-customization-uuid: "f75c3628-12e9-4c70-be98-d347045a3f70"
409 vnf-model-customization-uuid: *vnf-model-cust-uuid
410 vf-module-id: "960c9189-4a68-49bc-8bef-88e621fef250"
411 aic-cloud-region: *cloud-region
412 - name: resource-assignment for vfw
413 request:
414 commonHeader: *commonHeader
415 actionIdentifiers: *actionIdentifiers
416 payload:
417 resource-assignment-request:
418 template-prefix:
419 - "vfw"
420 resource-assignment-properties:
421 nfc-naming-code: "vfw"
422 k8s-rb-profile-name: *k8s-profile-name
423 service-instance-id: *service-id
424 vnf-id: *vnf-id
425 vf-module-model-customization-uuid: "f9afd9bb-7796-4aff-8f53-681513115742"
426 vnf-model-customization-uuid: *vnf-model-cust-uuid
427 vf-module-id: "1ff35d90-623b-450e-abb2-10a515249fbe"
428 aic-cloud-region: *cloud-region
429
430
431**NOTE:** This call will run all the calls (given in input_uat.yml) towards CDS and records the functionality, so there needs to be working environment (SDNC, AAI, Naming, Netbox, etc.) to record valid final uat.yml.
432As an output of this call final uat.yml content is received. Final uat.yml in this use case looks like this:
433
434::
435
436 TODO: the content.
437
438Currently UAT is broken in master `CCSDK-2155`_
439
440- Verify CBA with UAT
441
442 ::
443
444 curl -X POST -u ccsdkapps:ccsdkapps -F cba=@my_cba.zip http://<kube-node>:30499/api/v1/uat/verify
445
446where my_cba.zip is the CBA model with uat.yml (generated in spy step) inside Test folder.
447
448**TODO: add UAT POST to postman**
449
450Instantiation Overview
451......................
452
453The figure below shows all the interactions that take place during vFW CNF instantiation. It's not describing flow of actions (ordered steps) but rather component dependencies.
454
455.. figure:: files/vFW_CNF_CDS/Instantiation_topology.png
456 :align: center
457
458 vFW CNF CDS Use Case Runtime interactions.
459
460PART 1 - ONAP Installation
461--------------------------
4621-1 Deployment components
463~~~~~~~~~~~~~~~~~~~~~~~~~
464
465In order to run the vFW_CNF_CDS use case, we need ONAP Frankfurt Release (or later) and at least following components:
466
467======================================================= ===========
468ONAP Component name Describtion
469------------------------------------------------------- -----------
470AAI Required for Inventory Cloud Owner, Customer, Owning Entity, Service, Generic VNF, VF Module
471SDC VSP, VF and Service Modeling of the CNF
472DMAAP Distribution of the CSAR including CBA to all ONAP components
473SO Requires for Macro Orchestration using the generic building blocks
474CDS Resolution of cloud parameters including Helm override parameters for the CNF. Creation of the multicloud/k8s profile for CNF instantion.
475SDNC (needs to include netbox and Naming Generation mS) Provides GENERIC-RESOURCE-API for cloud Instantiation orchestration via CDS.
476Policy Used to Store Naming Policy
477AAF Used for Authentication and Authorization of requests
478Portal Required to access SDC.
479MSB Exposes multicloud interfaces used by SO.
Konrad Bańkacc67f632020-03-12 12:09:13 +0100480Multicloud K8S plugin part used to pass SO instantiation requests to external Kubernetes cloud region.
481Contrib Netbox utility #FIXME
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200482Robot Optional. Can be used for running automated tasks, like provisioning cloud customer, cloud region, service subscription, etc ..
483Shared Cassandra DB Used as a shared storage for ONAP components that rely on Cassandra DB, like AAI
484Shared Maria DB Used as a shared storage for ONAP components that rely on Maria DB, like SDNC, and SO
485======================================================= ===========
486
4871-2 Deployment
488~~~~~~~~~~~~~~
489
490In order to deploy such an instance, follow the `ONAP Deployment Guide`_
491
492As we can see from the guide, we can use an override file that helps us customize our ONAP deployment, without modifying the OOM Folder, so you can download this override file here, that includes the necessary components mentioned above.
493
494**override.yaml** file where enabled: true is set for each component needed in demo (by default all components are disabled).
495
496::
497
498 aai:
499 enabled: true
500 aaf:
501 enabled: true
502 cassandra:
503 enabled: true
504 cds:
505 enabled: true
506 contrib:
507 enabled: true
508 dmaap:
509 enabled: true
510 mariadb-galera:
511 enabled: true
512 msb:
513 enabled: true
514 multicloud:
515 enabled: true
516 policy:
517 enabled: true
518 portal:
519 enabled: true
520 robot:
521 enabled: true
522 sdc:
523 enabled: true
524 sdnc:
525 enabled: true
526 so:
527 enabled: true
528
529Then deploy ONAP with Helm with your override file.
530
531::
532
533 helm deploy onap local/onap --namespace onap -f ~/override.yaml
534
535In case redeployment needed `Helm Healer`_ could be a faster and convenient way to redeploy.
536
537::
538
539 helm-healer.sh -n onap -f ~/override.yaml -s /dockerdata-nfs --delete-all
540
541Or redeploy (clean re-deploy also data removed) just wanted components (Helm releases), cds in this example.
542
543::
544
545 helm-healer.sh -f ~/override.yaml -s /dockerdata-nfs/ -n onap -c onap-cds
546
547There are many instructions in ONAP wiki how to follow your deployment status and does it succeeded or not, mostly using Robot Health checks. One way we used is to skip the outermost Robot wrapper and use directly ete-k8s.sh to able to select checked components easily. Script is found from OOM git repository *oom/kubernetes/robot/ete-k8s.sh*.
548
549::
550
Konrad Bańkacc67f632020-03-12 12:09:13 +0100551 {
552 failed=
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200553 for comp in {aaf,aai,dmaap,msb,multicloud,policy,portal,sdc,sdnc,so}; do
554 if ! ./ete-k8s.sh onap health-$comp; then
555 failed=$failed,$comp
556 fi
557 done
558 if [ -n "$failed" ]; then
559 echo "These components failed: $failed"
560 false
561 else
562 echo "Healthcheck successful"
563 fi
Konrad Bańkacc67f632020-03-12 12:09:13 +0100564 }
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200565
566And check status of pods, deployments, jobs etc.
567
568::
569
570 kubectl -n onap get pods | grep -vie 'completed' -e 'running'
571 kubectl -n onap get deploy,sts,jobs
572
573
5741-3 Post Deployment
575~~~~~~~~~~~~~~~~~~~
576
577After completing the first part above, we should have a functional ONAP deployment for the Frankfurt Release.
578
579We will need to apply a few modifications to the deployed ONAP Frankfurt instance in order to run the use case.
580
Konrad Bańkacc67f632020-03-12 12:09:13 +0100581Retrieving logins and passwords of ONAP components
582..................................................
583
584Since Frankfurt release hardcoded passwords were mostly removed and it is possible to configure passwords of ONAP components in time of installation. In order to retrieve these passwords with associated logins it is required to get them with kubectl. Below is the procedure on mariadb-galera DB example.
585
586::
587
588 kubectl get secret `kubectl get secrets | grep mariadb-galera-db-root-password | awk {'print $1'}` -o jsonpath="{.data.login}" | base64 --decode
589 kubectl get secret `kubectl get secrets | grep mariadb-galera-db-root-password | awk {'print $1'}` -o jsonpath="{.data.password}" | base64 --decode
590
591In this case login is empty as the secret is dedicated to root user.
592
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200593Postman collection setup
594........................
595
596In this demo we have on purpose created all manual ONAP preparation steps (which in real life are automated) by using Postman so it will be clear what exactly is needed. Some of the steps like AAI population is automated by Robot scripts in other ONAP demos (**./demo-k8s.sh onap init**) and Robot script could be used for many parts also in this demo. Later when this demo is fully automated we probably update also Robot scripts to support this demo.
597
598Postman collection is used also to trigger instantion using SO APIs.
599
600Following steps are needed to setup postman:
601
602- Import this postman collection zip
603
Konrad Bańkacc67f632020-03-12 12:09:13 +0100604 :download: `Postman collection <files/vFW_CNF_CDS/postman.zip>`
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200605
Konrad Bańkacc67f632020-03-12 12:09:13 +0100606- Extract the zip and import 2 postman collection and environment files into Postman
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200607 - `vFW_CNF_CDS.postman_collection.json`
608 - `vFW_CNF_CDS.postman_environment.json`
609
610- For use case debugging purposes to get Kubernetes cluster external access to SO CatalogDB (GET operations only), modify SO CatalogDB service to NodePort instead of ClusterIP. You may also create separate own NodePort if you wish, but here we have just edited directly the service with kubectl. Note that the port number 30120 is used in postman collection.
611
612::
613
614 kubectl -n onap edit svc so-catalog-db-adapter
615 - .spec.type: ClusterIP
616 + .spec.type: NodePort
617 + .spec.ports[0].nodePort: 30120
618
619**Postman variables:**
620
621Most of the postman variables are automated by postman scripts and environment file provided, but there are few mandatory variables to fill by user.
622
623=================== ===================
624Variable Description
625------------------- -------------------
626k8s ONAP Kubernetes host
627sdnc_port port of sdnc service for accessing MDSAL
628cds-service-name name of service as defined in SDC
629cds-instance-name name of instantiated service (if ending with -{num}, will be autoincremented for each instantiation request)
630=================== ===================
631
632You can get the sdnc_port value with
633
634::
635
636 kubectl -n onap get svc sdnc -o json | jq '.spec.ports[]|select(.port==8282).nodePort'
637
638
639**TODO: change variable names something else than cds-xxx**
640
641
642AAI
643...
644
645Some basic entries are needed in ONAP AAI. These entries are needed ones per onap installation and do not need to be repeated when running multiple demos based on same definitions.
646
647Create all these entries into AAI in this order. Postman collection provided in this demo can be used for creating each entry.
648
649**Postman -> Robot Init Stuff**
650
651- Create Customer
652- Create Owning-entity
653- Create Platform
654- Create Project
655- Create Line Of Business
656
657Corresponding GET operations in postman can be used to verify entries created. Postman collection also includes some code that tests/verifies some basic issues e.g. gives error if entry already exists.
658
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200659SO BPMN endpoint fix for VNF adapter requests (v1 -> v2)
660........................................................
661
662SO Openstack adapter needs to be updated to use newer version. Here is also possible improvement area in SO. Openstack adapter is confusing in context of this use case as VIM is not Openstack but Kubernetes cloud region. In this use case we did not used Openstack at all.
663
664::
665
Konrad Bańkacc67f632020-03-12 12:09:13 +0100666 kubectl -n onap edit configmap onap-so-bpmn-infra-app-configmap
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200667 - .data."override.yaml".mso.adapters.vnf.rest.endpoint: http://so-openstack-adapter.onap:8087/services/rest/v1/vnfs
668 + .data."override.yaml".mso.adapters.vnf.rest.endpoint: http://so-openstack-adapter.onap:8087/services/rest/v2/vnfs
Konrad Bańkacc67f632020-03-12 12:09:13 +0100669 kubectl -n onap delete pod -l app=so-bpmn-infra
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200670
671Naming Policy
672.............
673
674Naming policy is needed to generate unique names for all instance time resources that are wanted to be modeled in the way naming policy is used. Those are normally VNF, VNFC and VF-module names, network names etc. Naming is general ONAP feature and not limited to this use case.
675
676The override.yaml file above has an option **"preload=true"**, that will tell the POLICY component to run the push_policies.sh script as the POLICY PAP pod starts up, which will in turn create the Naming Policy and push it.
677
678To check that the naming policy is created and pushed OK, we can run the commands below.
679
Konrad Bańkacc67f632020-03-12 12:09:13 +0100680FIXME - add instruction for uploading own naming policy !!!
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200681
682Network Naming mS
683+++++++++++++++++
684
685There's a strange feature or bug in naming service still at ONAP Frankfurt and following hack needs to be done to make it work.
686
687::
688
Konrad Bańkacc67f632020-03-12 12:09:13 +0100689 # Go into naming service database
690 kubectl -n onap exec onap-mariadb-galera-0 -it -- mysql -uroot -psecretpassword -D nengdb
691 select * from EXTERNAL_INTERFACE;
692 # Delete entries from EXTERNAL_INTERFACE table
693 delete from EXTERNAL_INTERFACE;
694 select * from EXTERNAL_INTERFACE;
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200695
Konrad Bańkacc67f632020-03-12 12:09:13 +0100696.. note:: The required credentials can be retrieved with instruction `Retrieving logins and passwords of ONAP components`_
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200697
698PART 2 - Installation of managed Kubernetes cluster
699---------------------------------------------------
700
701In this demo the target cloud region is a Kubernetes cluster of your choice basically just like with Openstack. ONAP platform is a bit too much hard wired to Openstack and it's visible in many demos.
702
7032-1 Installation of Managed Kubernetes
704~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
705
706In this demo we use Kubernetes deployment used by ONAP multicloud/k8s team to test their plugin features see `KUD readthedocs`_. There's also some outdated instructions in ONAP wiki `KUD in Wiki`_.
707
708KUD deployment is fully automated and also used in ONAP's CI/CD to automatically verify all `Multicloud k8s gerrit`_ commits (see `KUD Jenkins ci/cd verification`_) and that's quite good (and rare) level of automated integration testing in ONAP. KUD deployemnt is used as it's installation is automated and it also includes bunch of Kubernetes plugins used to tests various k8s plugin features. In addition to deployement, KUD repository also contains test scripts to automatically test multicloud/k8s plugin features. Those scripts are run in CI/CD.
709
710See `KUD subproject in github`_ for a list of additional plugins this Kubernetes deployment has. In this demo the tested CNF is dependent on following plugins:
711
712- ovn4nfv
713- Multus
714- Virtlet
715
716Follow instructions in `KUD readthedocs`_ and install target Kubernetes cluster in your favorite machine(s), simplest being just one machine. Your cluster nodes(s) needs to be accessible from ONAP Kuberenetes nodes.
717
7182-2 Cloud Registration
719~~~~~~~~~~~~~~~~~~~~~~
720
721Managed Kubernetes cluster is registered here into ONAP as one cloud region. This obviously is done just one time for this particular cloud. Cloud registration information is kept in AAI.
722
723Postman collection have folder/entry for each step. Execute in this order.
724
725**Postman -> AAI -> Create**
726
727- Create Complex
728- Create Cloud Region
729- Create Complex-Cloud Region Relationship
730- Create Service
731- Create Service Subscription
732- Create Cloud Tenant
733- Create Availability Zone
734
735**Postman -> Multicloud**
736
737- Upload Connectivity Info **TODO: where to get kubeconfig file?**
738
739
Konrad Bańkacc67f632020-03-12 12:09:13 +0100740**SO Cloud region configuration**
741
742SO database needs to be (manually) modified for SO to know that this particular cloud region is to be handled by multicloud. Values we insert needs to obviously match to the ones we populated into AAI.
743
744The related code part in SO is here: `SO Cloud Region Selection`_
745It's possible improvement place in SO to rather get this information directly from AAI.
746
747::
748
749 kubectl -n onap exec onap-mariadb-galera-0 -it -- mysql -uroot -psecretpassword -D catalogdb
750 select * from cloud_sites;
751 insert into cloud_sites(ID, REGION_ID, IDENTITY_SERVICE_ID, CLOUD_VERSION, CLLI, ORCHESTRATOR) values("k8sregionfour", "k8sregionfour", "DEFAULT_KEYSTONE", "2.5", "clli2", "multicloud");
752 select * from cloud_sites;
753 exit
754
755.. note:: The required credentials can be retrieved with instruction `Retrieving logins and passwords of ONAP components`_
756
Samuli Silviusa58b0b42020-02-18 10:00:47 +0200757PART 3 - Execution of the Use Case
758----------------------------------
759
760This part contains all the steps to run the use case by using ONAP GUIs and Postman.
761
762Following picture describes the overall sequential flow of the use case.
763
764.. figure:: files/vFW_CNF_CDS/vFW_CNF_CDS_Flow.png
765 :align: center
766
767 vFW CNF CDS Use Case sequence flow.
768
7693-1 Onboarding
770~~~~~~~~~~~~~~
771
772Creating CSAR
773.............
774
775Whole content of this use case is stored into single git repository and ONAP user content package CSAR package can be created with provided Makefile.
776
777Complete content can be packaged to single CSAR file in following way:
778(Note: requires Helm installed)
779
780::
781
782 git clone https://gerrit.onap.org/r/demo
783 cd heat/vFW_CNF_CDS/templates
784 make
785
786The output looks like:
787::
788
789 mkdir csar/
790 make -C helm
791 make[1]: Entering directory '/home/samuli/onapCode/demo/heat/vFW_CNF_CDS/templates/helm'
792 rm -f base_template-*.tgz
793 rm -f base_template_cloudtech_k8s_charts.tgz
794 helm package base_template
795 Successfully packaged chart and saved it to: /home/samuli/onapCode/demo/heat/vFW_CNF_CDS/templates/helm/base_template-0.2.0.tgz
796 mv base_template-*.tgz base_template_cloudtech_k8s_charts.tgz
797 rm -f vpkg-*.tgz
798 rm -f vpkg_cloudtech_k8s_charts.tgz
799 helm package vpkg
800 Successfully packaged chart and saved it to: /home/samuli/onapCode/demo/heat/vFW_CNF_CDS/templates/helm/vpkg-0.2.0.tgz
801 mv vpkg-*.tgz vpkg_cloudtech_k8s_charts.tgz
802 rm -f vfw-*.tgz
803 rm -f vfw_cloudtech_k8s_charts.tgz
804 helm package vfw
805 Successfully packaged chart and saved it to: /home/samuli/onapCode/demo/heat/vFW_CNF_CDS/templates/helm/vfw-0.2.0.tgz
806 mv vfw-*.tgz vfw_cloudtech_k8s_charts.tgz
807 rm -f vsn-*.tgz
808 rm -f vsn_cloudtech_k8s_charts.tgz
809 helm package vsn
810 Successfully packaged chart and saved it to: /home/samuli/onapCode/demo/heat/vFW_CNF_CDS/templates/helm/vsn-0.2.0.tgz
811 mv vsn-*.tgz vsn_cloudtech_k8s_charts.tgz
812 make[1]: Leaving directory '/home/samuli/onapCode/demo/heat/vFW_CNF_CDS/templates/helm'
813 mv helm/*.tgz csar/
814 cp base/* csar/
815 cd cba/ && zip -r vFW_CDS_CNF.zip .
816 adding: TOSCA-Metadata/ (stored 0%)
817 adding: TOSCA-Metadata/TOSCA.meta (deflated 38%)
818 adding: Templates/ (stored 0%)
819 adding: Templates/base_template-mapping.json (deflated 92%)
820 adding: Templates/vfw-template.vtl (deflated 87%)
821 adding: Templates/nf-params-mapping.json (deflated 86%)
822 adding: Templates/vsn-mapping.json (deflated 94%)
823 adding: Templates/vnf-template.vtl (deflated 90%)
824 adding: Templates/vpkg-mapping.json (deflated 94%)
825 adding: Templates/vsn-template.vtl (deflated 87%)
826 adding: Templates/nf-params-template.vtl (deflated 44%)
827 adding: Templates/base_template-template.vtl (deflated 85%)
828 adding: Templates/vfw-mapping.json (deflated 94%)
829 adding: Templates/vnf-mapping.json (deflated 92%)
830 adding: Templates/vpkg-template.vtl (deflated 86%)
831 adding: Templates/k8s-profiles/ (stored 0%)
832 adding: Templates/k8s-profiles/vfw-cnf-cds-base-profile.tar.gz (stored 0%)
833 adding: Scripts/ (stored 0%)
834 adding: Scripts/kotlin/ (stored 0%)
835 adding: Scripts/kotlin/KotlinK8sProfileUpload.kt (deflated 75%)
836 adding: Scripts/kotlin/README.md (stored 0%)
837 adding: Definitions/ (stored 0%)
838 adding: Definitions/artifact_types.json (deflated 57%)
839 adding: Definitions/vFW_CNF_CDS.json (deflated 81%)
840 adding: Definitions/node_types.json (deflated 86%)
841 adding: Definitions/policy_types.json (stored 0%)
842 adding: Definitions/data_types.json (deflated 93%)
843 adding: Definitions/resources_definition_types.json (deflated 95%)
844 adding: Definitions/relationship_types.json (stored 0%)
845 mv cba/vFW_CDS_CNF.zip csar/
846 #Can't use .csar extension or SDC will panic
847 cd csar/ && zip -r vfw_k8s_demo.zip .
848 adding: base_template_cloudtech_k8s_charts.tgz (stored 0%)
849 adding: MANIFEST.json (deflated 83%)
850 adding: base_template.yaml (deflated 63%)
851 adding: vsn_cloudtech_k8s_charts.tgz (stored 0%)
852 adding: vfw_cloudtech_k8s_charts.tgz (stored 0%)
853 adding: vpkg_cloudtech_k8s_charts.tgz (stored 0%)
854 adding: vsn.yaml (deflated 75%)
855 adding: vpkg.yaml (deflated 76%)
856 adding: vfw.yaml (deflated 77%)
857 adding: vFW_CDS_CNF.zip (stored 0%)
858 adding: base_template.env (deflated 23%)
859 adding: vsn.env (deflated 53%)
860 adding: vpkg.env (deflated 55%)
861 adding: vfw.env (deflated 58%)
862 mv csar/vfw_k8s_demo.zip .
863 $
864
865and package **vfw_k8s_demo.zip** file is created containing all sub-models.
866
867Import this package into SDC and follow onboarding steps.
868
869Service Creation with SDC
870.........................
871
872Create VSP, VLM, VF, ..., Service in SDC
873 - Remember during VSP onboard to choose "Network Package" Onboarding procedure
874
875**TODO: make better steps**
876
877On VF level, add CBA separately as it's not onboarded by default from CSAR correctly
878
879Service -> Properties Assignment -> Choose VF (at right box):
880 - skip_post_instantiation_configuration - True
881 - sdnc_artifact_name - vnf
882 - sdnc_model_name - vFW_CNF_CDS
883 - sdnc_model_version - 1.0.0
884
885Distribution Of Service
886.......................
887
888Distribute service. **TODO: add screenshot to distribution SDC UI**
889
890Verify distribution for:
891
892- SDC:
893
894 SDC Catalog database should have our service now defined.
895
896 **Postman -> SDC/SO -> SDC Catalog Service**
897
898 ::
899
900 {
901 "uuid": "40f4cca8-1025-4f2e-8435-dda898f0caab",
902 "invariantUUID": "b0ecfa3b-4394-4727-be20-c2c718002093",
903 "name": "TestvFWService",
904 "version": "3.0",
905 "toscaModelURL": "/sdc/v1/catalog/services/40f4cca8-1025-4f2e-8435-dda898f0caab/toscaModel",
906 "category": "Mobility",
907 "lifecycleState": "CERTIFIED",
908 "lastUpdaterUserId": "jm0007",
909 "distributionStatus": "DISTRIBUTED"
910 }
911
912 Listing should contain entry with our service name **TestvFWService** **TODO: Let's use service name different from other demos**
913
914- SO:
915
916 SO Catalog database should have our service NFs defined now.
917
918 **Postman -> SDC/SO -> SO Catalog DB Service xNFs**
919
920 ::
921
922 {
923 "serviceVnfs":[
924 {
925 "modelInfo":{
926 "modelName":"FixedVFW",
927 "modelUuid":"a6c43cc8-677d-447d-afc2-795212182dc0",
928 "modelInvariantUuid":"074555e3-21b9-47ba-9ad9-78028029a36d",
929 "modelVersion":"1.0",
930 "modelCustomizationUuid":"366c007e-7684-4a0b-a2f4-9815174bec55",
931 "modelInstanceName":"FixedVFW 0"
932 },
933 "toscaNodeType":"org.openecomp.resource.vf.Fixedvfw",
934 "nfFunction":null,
935 "nfType":null,
936 "nfRole":null,
937 "nfNamingCode":null,
938 "multiStageDesign":"false",
939 "vnfcInstGroupOrder":null,
940 "resourceInput":"{\"vf_module_id\":\"vFirewallCL\",\"skip_post_instantiation_configuration\":\"true\",\"vsn_flavor_name\":\"PUT THE VM FLAVOR NAME HERE (m1.medium suggested)\",\"vfw_int_private2_ip_0\":\"192.168.20.100\",\"int_private1_subnet_id\":\"zdfw1fwl01_unprotected_sub\",\"public_net_id\":\"PUT THE PUBLIC NETWORK ID HERE\",\"vnf_name\":\"vFW_NextGen\",\"onap_private_subnet_id\":\"PUT THE ONAP PRIVATE NETWORK NAME HERE\",\"vsn_int_private2_ip_0\":\"192.168.20.250\",\"sec_group\":\"PUT THE ONAP SECURITY GROUP HERE\",\"vfw_name_0\":\"zdfw1fwl01fwl01\",\"nexus_artifact_repo\":\"https://nexus.onap.org\",\"onap_private_net_cidr\":\"10.0.0.0/16\",\"vpg_onap_private_ip_0\":\"10.0.100.2\",\"dcae_collector_ip\":\"10.0.4.1\",\"vsn_image_name\":\"PUT THE VM IMAGE NAME HERE (UBUNTU 1404)\",\"vnf_id\":\"vSink_demo_app\",\"vpg_flavor_name\":\"PUT THE VM FLAVOR NAME HERE (m1.medium suggested)\",\"dcae_collector_port\":\"30235\",\"vfw_int_private2_floating_ip\":\"192.168.10.200\",\"vpg_name_0\":\"zdfw1fwl01pgn01\",\"int_private2_subnet_id\":\"zdfw1fwl01_protected_sub\",\"int_private2_net_cidr\":\"192.168.20.0/24\",\"nf_naming\":\"true\",\"vsn_name_0\":\"zdfw1fwl01snk01\",\"multi_stage_design\":\"false\",\"vpg_image_name\":\"PUT THE VM IMAGE NAME HERE (UBUNTU 1404)\",\"onap_private_net_id\":\"PUT THE ONAP PRIVATE NETWORK NAME HERE\",\"availability_zone_max_count\":\"1\",\"sdnc_artifact_name\":\"vnf\",\"vsn_onap_private_ip_0\":\"10.0.100.3\",\"vfw_flavor_name\":\"PUT THE VM FLAVOR NAME HERE (m1.medium suggested)\",\"demo_artifacts_version\":\"1.6.0-SNAPSHOT\",\"pub_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQXYJYYi3/OUZXUiCYWdtc7K0m5C0dJKVxPG0eI8EWZrEHYdfYe6WoTSDJCww+1qlBSpA5ac/Ba4Wn9vh+lR1vtUKkyIC/nrYb90ReUd385Glkgzrfh5HdR5y5S2cL/Frh86lAn9r6b3iWTJD8wBwXFyoe1S2nMTOIuG4RPNvfmyCTYVh8XTCCE8HPvh3xv2r4egawG1P4Q4UDwk+hDBXThY2KS8M5/8EMyxHV0ImpLbpYCTBA6KYDIRtqmgS6iKyy8v2D1aSY5mc9J0T5t9S2Gv+VZQNWQDDKNFnxqYaAo1uEoq/i1q63XC5AD3ckXb2VT6dp23BQMdDfbHyUWfJN\",\"key_name\":\"vfw_key\",\"vfw_int_private1_ip_0\":\"192.168.10.100\",\"sdnc_model_version\":\"1.0.0\",\"int_private1_net_cidr\":\"192.168.10.0/24\",\"install_script_version\":\"1.6.0-SNAPSHOT\",\"vfw_image_name\":\"PUT THE VM IMAGE NAME HERE (UBUNTU 1404)\",\"vfw_onap_private_ip_0\":\"10.0.100.1\",\"vpg_int_private1_ip_0\":\"192.168.10.200\",\"int_private2_net_id\":\"zdfw1fwl01_protected\",\"cloud_env\":\"PUT openstack OR rackspace HERE\",\"sdnc_model_name\":\"vFW_CNF_CDS\",\"int_private1_net_id\":\"zdfw1fwl01_unprotected\"}",
941 "vfModules":[
942 {
943 "modelInfo":{
944 "modelName":"Fixedvfw..base_template..module-0",
945 "modelUuid":"8bb9fa50-3e82-4664-bd1c-a29267be726a",
946 "modelInvariantUuid":"750b39d0-7f99-4b7f-9a22-c15c7348221d",
947 "modelVersion":"1",
948 "modelCustomizationUuid":"603eadfe-50d6-413a-853c-46f5a8e2ddc7"
949 },
950 "isBase":true,
951 "vfModuleLabel":"base_template",
952 "initialCount":1,
953 "hasVolumeGroup":false
954 },
955 {
956 "modelInfo":{
957 "modelName":"Fixedvfw..vsn..module-1",
958 "modelUuid":"027696a5-a605-44ea-9362-391a6b217de0",
959 "modelInvariantUuid":"2e3b182d-7ee3-4a8d-9c2b-056188b6eb53",
960 "modelVersion":"1",
961 "modelCustomizationUuid":"f75c3628-12e9-4c70-be98-d347045a3f70"
962 },
963 "isBase":false,
964 "vfModuleLabel":"vsn",
965 "initialCount":0,
966 "hasVolumeGroup":false
967 },
968 {
969 "modelInfo":{
970 "modelName":"Fixedvfw..vpkg..module-2",
971 "modelUuid":"64af8ad0-cb81-42a2-a069-7d246d8bff5d",
972 "modelInvariantUuid":"5c9f3097-26ba-41fb-928b-f7ddc31f6f52",
973 "modelVersion":"1",
974 "modelCustomizationUuid":"32ffad03-d38d-46d5-b4a6-a3b0b6112ffc"
975 },
976 "isBase":false,
977 "vfModuleLabel":"vpkg",
978 "initialCount":0,
979 "hasVolumeGroup":false
980 },
981 {
982 "modelInfo":{
983 "modelName":"Fixedvfw..vfw..module-3",
984 "modelUuid":"55d889e4-ff38-4ed0-a159-60392c968042",
985 "modelInvariantUuid":"5c6a06e9-1168-4b01-bd2a-38d544c6d131",
986 "modelVersion":"1",
987 "modelCustomizationUuid":"f9afd9bb-7796-4aff-8f53-681513115742"
988 },
989 "isBase":false,
990 "vfModuleLabel":"vfw",
991 "initialCount":0,
992 "hasVolumeGroup":false
993 }
994 ],
995 "groups":[
996
997 ]
998 }
999 ]
1000 }
1001
1002- SDNC:
1003
1004 SDNC should have it's database updated with sdnc_* properties that were set during service modeling.
1005
1006 **TODO: verify below the customization_uuid where it is got**
1007
1008 ::
1009
1010 kubectl -n onap exec onap-mariadb-galera-mariadb-galera-0 -it -- sh
1011 mysql -uroot -psecretpassword -D sdnctl
1012 MariaDB [sdnctl]> select sdnc_model_name, sdnc_model_version, sdnc_artifact_name from VF_MODEL WHERE customization_uuid = '88e0e9a7-5bd2-4689-ae9e-7fc167d685a2';
1013 +-----------------+--------------------+--------------------+
1014 | sdnc_model_name | sdnc_model_version | sdnc_artifact_name |
1015 +-----------------+--------------------+--------------------+
1016 | vFW_CNF_CDS | 1.0.0 | vnf |
1017 +-----------------+--------------------+--------------------+
1018 1 row in set (0.00 sec)
1019
1020 # Where customization_uuid is the modelCustomizationUuid of the VNf (serviceVnfs response in 2nd postman call from SO Catalog DB)
1021
Konrad Bańkacc67f632020-03-12 12:09:13 +01001022.. note:: The required credentials can be retrieved with instruction `Retrieving logins and passwords of ONAP components`_
1023
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001024- CDS:
1025
1026 CDS should onboard CBA uploaded as part of VF.
1027
1028 **Postman -> CDS -> CDS Blueprint List CBAs**
1029
1030 ::
1031
1032 {
1033 "blueprintModel": {
1034 "id": "761bbe69-8357-454b-9f37-46d9da8ecad6",
1035 "artifactUUId": null,
1036 "artifactType": "SDNC_MODEL",
1037 "artifactVersion": "1.0.0",
1038 "artifactDescription": "Controller Blueprint for vFW_CNF_CDS:1.0.0",
1039 "internalVersion": null,
1040 "createdDate": "2020-02-21T12:57:43.000Z",
1041 "artifactName": "vFW_CNF_CDS",
1042 "published": "Y",
1043 "updatedBy": "Samuli Silvius <s.silvius@partner.samsung.com>",
1044 "tags": "Samuli Silvius, vFW_CNF_CDS"
1045 }
1046 }
1047
1048 The list should have the matching entries with SDNC database:
1049
1050 - sdnc_model_name == artifactName
1051 - sdnc_model_version == artifactVersion
1052
1053- K8splugin:
1054
1055 K8splugin should onboard 4 resource bundles related to helm resources:
1056
1057 **Postman -> Multicloud -> List Resource Bundle Definitions**
1058
1059 ::
1060
1061 [
1062 {
1063 "rb-name": "750b39d0-7f99-4b7f-9a22-c15c7348221d",
1064 "rb-version": "8bb9fa50-3e82-4664-bd1c-a29267be726a",
1065 "chart-name": "base_template",
1066 "description": "",
1067 "labels": {
1068 "vnf_customization_uuid": "603eadfe-50d6-413a-853c-46f5a8e2ddc7"
1069 }
1070 },
1071 {
1072 "rb-name": "2e3b182d-7ee3-4a8d-9c2b-056188b6eb53",
1073 "rb-version": "027696a5-a605-44ea-9362-391a6b217de0",
1074 "chart-name": "vsn",
1075 "description": "",
1076 "labels": {
1077 "vnf_customization_uuid": "f75c3628-12e9-4c70-be98-d347045a3f70"
1078 }
1079 },
1080 {
1081 "rb-name": "5c9f3097-26ba-41fb-928b-f7ddc31f6f52",
1082 "rb-version": "64af8ad0-cb81-42a2-a069-7d246d8bff5d",
1083 "chart-name": "vpkg",
1084 "description": "",
1085 "labels": {
1086 "vnf_customization_uuid": "32ffad03-d38d-46d5-b4a6-a3b0b6112ffc"
1087 }
1088 },
1089 {
1090 "rb-name": "5c6a06e9-1168-4b01-bd2a-38d544c6d131",
1091 "rb-version": "55d889e4-ff38-4ed0-a159-60392c968042",
1092 "chart-name": "vfw",
1093 "description": "",
1094 "labels": {
1095 "vnf_customization_uuid": "f9afd9bb-7796-4aff-8f53-681513115742"
1096 }
1097 }
1098 ]
1099
11003-2 CNF Instantiation
1101~~~~~~~~~~~~~~~~~~~~~
1102
1103This is the whole beef of the use case and furthermore the core of it is that we can instantiate any amount of instances of the same CNF each running and working completely of their own. Very basic functionality in VM (VNF) side but for Kubernetes and ONAP integration this is the first milestone towards other normal use cases familiar for VNFs.
1104
1105Use again Postman to trigger instantion from SO interface. Postman collection is automated to populate needed parameters when queries are run in correct order. If you did not already run following 2 queries after distribution (to verify distribution), run those now:
1106
1107- **Postman -> SDC/SO -> SDC Catalog Service**
1108- **Postman -> SDC/SO -> SO Catalog DB Service xNFs**
1109
1110Now actual instantiation can be triggered with:
1111
1112**Postman -> SDC/SO -> SO Self-Serve Service Assign & Activate**
1113
1114Follow progress with SO's GET request:
1115
1116**Postman -> SDC/SO -> SO Infra Active Requests**
1117
1118The successful reply payload in that query should start like this:
1119
1120::
1121
1122 {
1123 "clientRequestId": null,
1124 "action": "createInstance",
1125 "requestStatus": "COMPLETED",
1126 "statusMessage": "Failed to create self-serve assignment for vf-module with vf-module-id=b70112fd-f6b2-44fe-a55c-6928d61843bf with error: Encountered error from self-serve-generate-name with error: Error from NameGenerationNode Assign",
1127 "rollbackStatusMessage": null,
1128 "flowStatus": "Execution of UnassignVfModuleBB has completed successfully, next invoking UnassignVfModuleBB (Execution Path progress: BBs completed = 1; BBs remaining = 4).",
1129 "retryStatusMessage": null,
1130 ...
1131
1132**TODO: fix COMPLETED payload**
1133
1134Progress can be followed also with `SO Monitoring`_.
1135
1136Second instance Instantion
1137..........................
1138
1139To finally verify that all the work done within this demo, it should be possible to instantiate second vFW instance successfully.
1140
1141Trigger again:
1142
1143**Postman -> SDC/SO -> SO Self-Serve Service Assign & Activate**
1144
1145**TODO: update to seconf call in postman**
1146
11473-3 Results and Logs
1148~~~~~~~~~~~~~~~~~~~~
1149
1150Now Kubernetes version of vFW multiple instances are running in target VIM (KUD deployment).
1151
1152.. figure:: files/vFW_CNF_CDS/vFW_Instance_In_Kubernetes.png
1153 :align: center
1154
1155 vFW Instance In Kubernetes
1156
1157To review situation after instantiation from different ONAP components, most of the info can be found using Postman queries provided. For each query, example response payload(s) is/are saved and can be found from top right corner of the Postman window.
1158
1159Execute following Postman queries and check example section to see the valid results.
1160
1161======================== =================
1162Verify Target Postman query
1163------------------------ -----------------
1164Service Instances in AAI **Postman -> AAI -> List Service Instances**
1165Generic VNFs in AAI **Postman -> AAI -> List VNF Instances**
1166K8S Instances in KUD **Postman -> Multicloud -> List Instances**
1167======================== =================
1168
1169Query also directly from VIM:
1170
1171**TODO: label filters needed here. Namespace?**
1172
1173::
1174
1175 #
1176 ubuntu@kud-host:~$ kubectl get pods,svc,networks,cm,network-attachment-definition,deployments
1177 NAME READY STATUS RESTARTS AGE
Konrad Bańkacc67f632020-03-12 12:09:13 +01001178 pod/vfw-17f6f7d3-8424-4550-a188-cd777f0ab48f-7cfb9949d9-8b5vg 1/1 Running 0 22s
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001179 pod/vfw-19571429-4af4-49b3-af65-2eb1f97bba43-75cd7c6f76-4gqtz 1/1 Running 0 11m
1180 pod/vpg-5ea0d3b0-9a0c-4e88-a2e2-ceb84810259e-f4485d485-pln8m 1/1 Running 0 11m
1181 pod/vpg-8581bc79-8eef-487e-8ed1-a18c0d638b26-6f8cff54d-dvw4j 1/1 Running 0 32s
1182 pod/vsn-8e7ac4fc-2c31-4cf8-90c8-5074c5891c14-5879c56fd-q59l7 2/2 Running 0 11m
1183 pod/vsn-fdc9b4ba-c0e9-4efc-8009-f9414ae7dd7b-5889b7455-96j9d 2/2 Running 0 30s
1184
1185 NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
1186 service/kubernetes ClusterIP 10.244.0.1 <none> 443/TCP 48d
1187 service/vpg-5ea0d3b0-9a0c-4e88-a2e2-ceb84810259e-management-api NodePort 10.244.43.245 <none> 2831:30831/TCP 11m
1188 service/vpg-8581bc79-8eef-487e-8ed1-a18c0d638b26-management-api NodePort 10.244.1.45 <none> 2831:31831/TCP 33s
1189 service/vsn-8e7ac4fc-2c31-4cf8-90c8-5074c5891c14-darkstat-ui NodePort 10.244.16.187 <none> 667:30667/TCP 11m
1190 service/vsn-fdc9b4ba-c0e9-4efc-8009-f9414ae7dd7b-darkstat-ui NodePort 10.244.20.229 <none> 667:31667/TCP 30s
1191
1192 NAME AGE
1193 network.k8s.plugin.opnfv.org/55118b80-8470-4c99-bfdf-d122cd412739-management-network 40s
1194 network.k8s.plugin.opnfv.org/55118b80-8470-4c99-bfdf-d122cd412739-protected-network 40s
1195 network.k8s.plugin.opnfv.org/55118b80-8470-4c99-bfdf-d122cd412739-unprotected-network 40s
1196 network.k8s.plugin.opnfv.org/567cecc3-9692-449e-877a-ff0b560736be-management-network 11m
1197 network.k8s.plugin.opnfv.org/567cecc3-9692-449e-877a-ff0b560736be-protected-network 11m
1198 network.k8s.plugin.opnfv.org/567cecc3-9692-449e-877a-ff0b560736be-unprotected-network 11m
1199
1200 NAME DATA AGE
1201 configmap/vfw-17f6f7d3-8424-4550-a188-cd777f0ab48f-configmap 6 22s
1202 configmap/vfw-19571429-4af4-49b3-af65-2eb1f97bba43-configmap 6 11m
1203 configmap/vpg-5ea0d3b0-9a0c-4e88-a2e2-ceb84810259e-configmap 6 11m
1204 configmap/vpg-8581bc79-8eef-487e-8ed1-a18c0d638b26-configmap 6 33s
1205 configmap/vsn-8e7ac4fc-2c31-4cf8-90c8-5074c5891c14-configmap 2 11m
1206 configmap/vsn-fdc9b4ba-c0e9-4efc-8009-f9414ae7dd7b-configmap 2 30s
1207
1208 NAME AGE
1209 networkattachmentdefinition.k8s.cni.cncf.io/55118b80-8470-4c99-bfdf-d122cd412739-ovn-nat 40s
1210 networkattachmentdefinition.k8s.cni.cncf.io/567cecc3-9692-449e-877a-ff0b560736be-ovn-nat 11m
1211
1212 NAME READY UP-TO-DATE AVAILABLE AGE
Konrad Bańkacc67f632020-03-12 12:09:13 +01001213 deployment.extensions/vfw-17f6f7d3-8424-4550-a188-cd777f0ab48f 1/1 1 1 22s
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001214 deployment.extensions/vfw-19571429-4af4-49b3-af65-2eb1f97bba43 1/1 1 1 11m
1215 deployment.extensions/vpg-5ea0d3b0-9a0c-4e88-a2e2-ceb84810259e 1/1 1 1 11m
1216 deployment.extensions/vpg-8581bc79-8eef-487e-8ed1-a18c0d638b26 1/1 1 1 33s
1217 deployment.extensions/vsn-8e7ac4fc-2c31-4cf8-90c8-5074c5891c14 1/1 1 1 11m
1218 deployment.extensions/vsn-fdc9b4ba-c0e9-4efc-8009-f9414ae7dd7b 1/1 1 1 30s
1219
1220
1221Component Logs From The Execution
1222.................................
1223
1224All logs from the use case execution are here:
1225
Konrad Bańkacc67f632020-03-12 12:09:13 +01001226 :download: `logs <files/vFW_CNF_CDS/logs.zip>`
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001227
1228- `so-bpmn-infra_so-bpmn-infra_debug.log`
1229- SO openstack adapter
1230- `sdnc_sdnc_karaf.log`
1231
1232 From karaf.log all requests (payloads) to CDS can be found by searching following string:
1233
1234 ``'Sending request below to url http://cds-blueprints-processor-http:8080/api/v1/execution-service/process'``
1235
1236- `cds-blueprints-processor_cds-blueprints-processor_POD_LOG.log`
1237- `multicloud-k8s_multicloud-k8s_POD_LOG.log`
1238- network naming
1239
1240Debug log
1241+++++++++
1242
1243In case more detailed logging is needed, here's instructions how to setup DEBUG logging for few components.
1244
1245- SDNC
1246
1247 ::
1248
1249 kubectl -n onap exec -it onap-sdnc-sdnc-0 -c sdnc /opt/opendaylight/bin/client log:set DEBUG
1250
1251
1252- CDS Blueprint Processor
1253
1254 ::
1255
1256 # Edit configmap
1257 kubectl -n onap edit configmap onap-cds-cds-blueprints-processor-configmap
1258
1259 # Edit logback.xml content change root logger level from info to debug.
1260 <root level="debug">
1261 <appender-ref ref="STDOUT"/>
1262 </root>
1263
1264 # Delete the POd to make changes effective
1265 kubectl -n onap delete pod $(kubectl -n onap get pod -l app=cds-blueprints-processor --no-headers | cut -d" " -f1)
1266
1267PART 4 - Summary and Future improvements needed
1268-----------------------------------------------
1269
1270This use case made CNFs onboarding and instantiation a little bit easier and closer to "normal" VNF way. Also CDS resource resolution capabilities were taken into use (compared to earlier demos) together with SO's MACRO workflow.
1271
1272CNF application in vFW (Helm charts) were divided to multiple Helm charts comply with vf-module structure of a Heat based VNF.
1273
1274Future development areas for this use case and in general for CNF support could be:
1275
1276- Automate manual initialization steps in to Robot init. Now all was done with Postman or manual step on command line.
1277- Automate use case in ONAP daily CI
1278- Include Closed Loop part of the vFW demo.
1279- Use multicloud/k8S API v2. Also consider profile concept future.
1280- Sync CDS model with `vFW_CNF_CDS Model`_ use case i.e. try to keep only single model regardless of xNF being Openstack or Kubernetes based.
1281- TOSCA based service and xNF models instead of dummy Heat wrapper. Won't work directly with current vf-module oriented SO workflows.
1282- vFW service with Openstack VNF and Kubernetes CNF
Konrad Bańkacc67f632020-03-12 12:09:13 +01001283- Post instantiation configuration with Day 2 configuration APIs of multicloud/k8S API
1284- Auto generation of instantiation specific helm resources in CDS and their population through profiles
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001285
1286
1287Multiple lower level bugs/issues were also found during use case development
1288
1289- Distribution of Helm package directly from CSAR package `SDC-2776`_
1290
1291
1292.. _ONAP Deployment Guide: https://docs.onap.org/en/frankfurt/submodules/oom.git/docs/oom_quickstart_guide.html#quick-start-label
1293.. _vFW_CNF_CDS Model: https://git.onap.org/demo/tree/heat/vFW_CNF_CDS?h=frankfurt
1294.. _vFW CDS Dublin: https://wiki.onap.org/display/DW/vFW+CDS+Dublin
1295.. _vFW CBA Model: https://git.onap.org/ccsdk/cds/tree/components/model-catalog/blueprint-model/service-blueprint/vFW?h=frankfurt
1296.. _vFW_Helm Model: https://git.onap.org/multicloud/k8s/tree/kud/demo/firewall?h=elalto
1297.. _vFW_NextGen: https://git.onap.org/demo/tree/heat/vFW_NextGen?h=elalto
1298.. _vFW EDGEX K8S: https://onap.readthedocs.io/en/elalto/submodules/integration.git/docs/docs_vfw_edgex_k8s.html
1299.. _vFW EDGEX K8S In ONAP Wiki: https://wiki.onap.org/display/DW/Deploying+vFw+and+EdgeXFoundry+Services+on+Kubernets+Cluster+with+ONAP
1300.. _KUD readthedocs: https://docs.onap.org/en/frankfurt/submodules/multicloud/k8s.git/docs
1301.. _KUD in Wiki: https://wiki.onap.org/display/DW/Kubernetes+Baremetal+deployment+setup+instructions
mrichommea958b982020-04-13 18:46:35 +02001302.. _Multicloud k8s gerrit: https://gerrit.onap.org/r/q/status:open+project:+multicloud/k8
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001303.. _KUD subproject in github: https://github.com/onap/multicloud-k8s/tree/master/kud
1304.. _KUD Jenkins ci/cd verification: https://jenkins.onap.org/job/multicloud-k8s-master-kud-deployment-verify-shell/
1305.. _SO Cloud Region Selection: https://git.onap.org/so/tree/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfPluginAdapterImpl.java?h=elalto#n1149
1306.. _SO Monitoring: http://so-monitoring:30224
1307.. _Jira Epic: https://jira.onap.org/browse/INT-1184
1308.. _Data Dictionary: https://git.onap.org/demo/tree/heat/vFW_CNF_CDS/templates/cba-dd.json?h=frankfurt
1309.. _Helm Healer: https://git.onap.org/oom/offline-installer/tree/tools/helm-healer.sh
mrichommea958b982020-04-13 18:46:35 +02001310.. _CDS UAT Testing: https://wiki.onap.org/display/DW/Modeling+Concepts
Samuli Silviusa58b0b42020-02-18 10:00:47 +02001311.. _postman.zip: files/vFW_CNF_CDS/postman.zip
1312.. _logs.zip: files/vFW_CNF_CDS/logs.zip
1313.. _SDC-2776: https://jira.onap.org/browse/SDC-2776
1314.. _MULTICLOUD-941: https://jira.onap.org/browse/MULTICLOUD-941
1315.. _CCSDK-2155: https://jira.onap.org/browse/CCSDK-2155
Konrad Bańkacc67f632020-03-12 12:09:13 +01001316.. _infra_workload: https://docs.onap.org/en/latest/submodules/multicloud/framework.git/docs/specs/multicloud_infra_workload.html
1317.. _SDNC-1116: https://jira.onap.org/browse/SDNC-1116
1318.. _SO-2727: https://jira.onap.org/browse/SO-2727
1319.. _SDNC-1109: https://jira.onap.org/browse/SDNC-1109
1320.. _SDC-2776: https://jira.onap.org/browse/SDC-2776
1321.. _INT-1255: https://jira.onap.org/browse/INT-1255
1322.. _SDNC-1130: https://jira.onap.org/browse/SDNC-1130