blob: 0c68a8950ca0f7d612991229ebeef8c1ab504492 [file] [log] [blame]
Isaku Yamahata1f7ba512018-02-01 10:08:43 -08001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3
4===================================================
5Container based network service/function deployment
6===================================================
7https://wiki.onap.org/pages/viewpage.action?pageId=16007890
8
9This proposal is to implement PoC in Beijing release(R-2) in order to
10get experience/feedback for future progress.
11
12
13Problem Description
14===================
15The current ONAP supports only VM based cloud infrastructure for VNF.
16On the other hand, in the industry container technology is getting more
17momentum. Increasing VNF density on each node and latency
18requirements are driving container based VNFs. This project enhances
19ONAP to support VNFs as containers in addition to VNFs as VMs.
20
21It is beneficial to support for multiple container orchestration technologies
22as cloud infrastructure:
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080023
Isaku Yamahata1f7ba512018-02-01 10:08:43 -080024* Allow VNFs to run within container technology and also allow closed
25 feedback loop same to VM based VIM. e.g. openstack.
26* Support for co-existence of VNF VMs and VNF containers
27* Add container orchestration technology in addition to the
28 traditional VM-based VIM or environment managed by ONAP.
29* Support for uniform network connectivity among VMs and containers.
30
31NOTE: This is different from OOM project `OOM`_. their scope is to
32deploy ONAP itself on k8s. Our scope is to deploy/manage VNFs on
33container/container orchestration engine(coe). The first target is
34k8s. Other CoE will also be addressed if someone steps up to support it.
35
36
37Proposed Change
38===============
39
40Scope for Beijing release(R-2)
41------------------------------
42Basic principle
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080043
Isaku Yamahata1f7ba512018-02-01 10:08:43 -080044* First baby step is to support containers in a Kubernetes cluster via a
45 Multicloud SBI /K8S Plugin
46 (other COE's(Container Orchestration Engine) are out of Beijing scope.
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080047 They are future scope.)
Isaku Yamahata1f7ba512018-02-01 10:08:43 -080048* Minimal implementation with zero impact on MVP of Multicloud Beijing work
49
50Use Cases
Ethan Lynnb3e79cc2018-06-05 17:26:55 +080051
Isaku Yamahata1f7ba512018-02-01 10:08:43 -080052* Sample VNFs(vFW and vDNS)
53 (vCPE use case is post Beijing release)
54 Both vFW and vDNS are targeted. Since custom TOSCA node definitions
55 are used (please refer to tosca section below), new TOSCA templates
56 are needed for them. (In future, post-Beijing, this will be revised
57 to share common TOSCA template.)
58
59Post Beijing Release
60--------------------
61In Beijing release, several design aspects are compromised to re-use
62the existing component/work flow with zero impact primarily because
63the long term solution is not ready to use. It's acceptable this effort
64in Beijing release is PoC or experimental to demonstrate functionality
65and to get experience for post-Beijing design/architecture.
66For example, the use of CSAR/new tosca node definitions are to re-use
67the existing code(i.e. Amsteldam release). After Beijing release, those
68will be revised for long term solution along with related topics. e.g.
69model driven API, modeling based on Beijing experience. Once we
70figured out what multicloud COE API should look like and what adapters
71in other projects(SO, APP-C) are needed(or not needed) in long term,
72the inter-project discussion (mainly with SO, APP-C) will start in
73Casablanca cycle.
74
75integration scenario
76--------------------
77* Register/unregister k8s cluster instances which are already deployed.
78 dynamic deployment of k8s is out of scope. It is assumed that admin knows
79 all the necessary parameters.
80* onboard VNFD/NSD to use container
81* Instantiate / de-instantiate containerized VNFs through K8S Plugin
82 over K8S cluster
83* Vnf configuration with sample VNFs(vFW, vDNS) with the existing configuration
84 interface. (no change to the existing configuration interface)
85
86
87Northbound API Design
88=====================
89
90REST API Impact and Base URL
91----------------------------
92
93Similar to other plugins(e.g. openstack plugin), k8s plugin has
94its own API endpoint and base URL so that it doesn't affect other
95multicloud northbound API.
96
97Base URL for kubernets plugin:
98
99https://msb.onap.org:80/api/multicloud/v0/
100
101NOTE: Each multicloud plugin has its own API endpoint(ip address).
102So the plugin is distinguished by endpoint IP address with MSB.
103"multicloud-kubernetes" name space for MSB is used.
104NOTE: each COE support has its own API end point and name space.
105their name spaces will be "multicloud-<coe name>". With model driven
106API, we will have API agnostic to COE. in that case the name space
107"multicloud-coe" will be used.
108
109cloud-id
110--------
111In ONAP, cloud-id is the format of <cloudOwner>_<cloudRegion>
112Since k8s doesn't have notion of region, cloud admin will assign
113unique string it as cloudRegion and it will be used as a part of cloud-id.
114
115APIs for VNF Lifecycle Management
116---------------------------------
117
118* PATH: /<cloud-id>/proxy/<resources>
119* METHOD: All methods
120
121Northbound components, e.g. APP-C, use these APIs for lifecycle management of
122VNF resources within the Kubernetes cluster, e.g. pods. In essence, these APIs
123provide simple proxy (or passthrough) functions with authorization adjustment
124to Kubernetes API Server so that the relevant lifecycle management operations
125are actually achieved by Kubernetes cluster itself. In another word, these API
126requests are proxied to "{kubernetes api prefix}/<resources>" within Kubernetes
127cluster without any changes to http/https request body.
128the API end point is stored in AA&I and the API consumer will get it from
129AA&I.
130
131For details of Kubernetes API, please refer to
132https://kubernetes.io/docs/reference/api-overview/
133
134NOTE: kubernetes doesn't have concept of region and tenant at this moment.
135So region and tenant_id isn't in path.
136NOTE: VF-C is ETSI NFV orchestrater.(NFV-O) In Beijing release, this isn't
137addressed because container is out of scope of ETSI NFV at the time of
138writing. Post-Beijing, this will be given consideration. First target
139is APP-C as it's easier.
140
141API for VNF Deployment
142----------------------
143
144* PATH: /<cloud-id>/package
145* METHOD: POST
146 media type of Content-Type and/or filename of Contest-Disposition are used
147 to specify package type.
148
149 As private media type, application/onap-multicloud-<coe name>-<type> is used.
150 More concretely for Beijing release the following media types are used.
151 * Content-Type: application/onap-multicloud-kubernetes-csar
152 * Content-Type: application/onap-multicloud-kubernetes-helm
153 As supplement, filename is also used to guess media type. As http header type
154 Contest-Disposition is used to pass filename.
155 * Content-Disposition: attachment; filename="fname.tgz"
156 first media type is tried and then filename is tried. If both are present
157 media type is used.
158
159This API provides northbound components, e.g. SO, with the function of
160deploying containerized VNF package into Kubernetes cluster. The VNF package
161is delivered as payload of HTTP request body in the API call. The VNF package
162could be a CSAR or Helm Charts.
163
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800164CSAR deployment package will include a yaml deployment file and other
165artifacts.
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800166This approach would work for simple VNFs consisting of single PODs.
167
168For VNFs comprising of multiple PODs which are dependent on each other, Helm
169based approach would be used. The VNF package would be described as a Helm
170package consisting of a set of Helm charts and k8s yamls for each constituent
171service that is part of the VNF.
172
173There would be no change required in the Northboud API from MultiCloud for
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800174either CSAR package or Helm package or any other package in the future. SO
175calls this MultiVIM Northbound API and sends the k8s package (e.g. csar, or
176tgz) as payload. k8s Plugin will distinguish package types based on its suffix
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800177and interact with k8s cluster appropriately:
178
179* For CSAR: k8s yaml file will be extracted from CSAR. k8s REST API server
180 will be called to create k8s resources (e.g. pods), which is equivalent to
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800181 "kubectl create -f <file.yaml>". The TOSCA file in CSAR is expected to
182 include onap.multicloud.container.kubernetes.proxy.nodes.resources_yaml
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800183 node which is explained below. In another word, Kubernetes yaml is stored as
184 artifact in CSAR. it is extracted and then it is fed to k8s API.
185
186* For TGZ: call Tiller API (gRPC-based) and pass through the Helm package
187
188The Kubernetes API Server (RESTful) or Helm Tiller Server (gRPC) URLs are
189configured for k8s Plugin when the Kubernetes cluster is created and Helm
190is installed.
191
192With this single API for package, when we need to add new package
193support in the future, no extra code in SO is needed.
194
195swagger.json
196------------
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800197
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800198* PATH: swagger.json
199 swagger.json for kubernetes API definitions
200* METHOD: GET
201
202returns swagger.json definitions of k8s API similar to other multicloud plugins
203
204Internal APIs for Implementations
205---------------------------------
206
207Some internal APIs may be needed by the implementation details of above
208northbound APIs. For example, when implementing VNF Deployment API above,
209we may need internal APIs to assist calling Helm Tiller Server or Kubernetes
210API Server, e.g. similar to "kubectl create -f xxx.yaml".
211
212The internal API, if needed, will be handled in implementation, which is out
213of scope of this section of the document.
214
215Test plan
216---------
217
218In this section test play is discussed. In Beijing cycle, test is minimal
219or stretched goal because the effort in Beijing is PoC/experimental
220to get experience. the following class of test would be planned as
221stretched goal.
222
223* Unit Test
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800224
225 * API input/output
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800226* functional test
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800227
228 * communication to backend(K8S API server, helm tiller server)
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800229* CSIT as end-to-end test
230
231
232Register/Unregister Kubernetes Cluster Instance
233===============================================
234
235This is done via A&AI ESR `ESR`_ to follow the way of the existing
236multicloud. some attributes, e.g. region id, don't make sense for
237k8s. In that case predefined value, e.g. 'default', are used.
238The info for basic authentication, i.e. the pair of (username, password),
239against kuberenetes API is registered and stored in A&AI.
240
241NOTE: ESR will call registry API when register a new VIM(k8s). we need to
242make sure that we have this API in this plugin and give them response.
243
244NOTE: HPA(kubernetes cluster features/capabilities) is out of scope
245for Beijing Assumption K8s cluster instance is already
246pre-build/deployed Dynamic instantiation is out of scope(for Beijing)
247
248attributes for A&AI ESR
249-----------------------
250
251This subsection describes how attributes for VIM registration are specified.
252For actual definitions, please refer to `ESR`_
253Some attributes doesn't apply to kubernetes so that such attributes will
254be left unspecified if it's optional or define pre-defined constants if
255it's mandatory.
256
257URI /api/aai-esr-server/v1/vims
258Operation Type POST
259
260Request Body:
261
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800262::
263
264 ------------------ ---------- ------- ----------------------------------------
265 Attribute Qualifier Content Description
266 ================== ========== ======= ========================================
267 cloudOwner M String any string as cloud owner
268 ------------------ ---------- ------- ----------------------------------------
269 cloudRegionId M String e.g. "kubernetes-<N>" as it doesn't apply
270 to k8s. Cloud admin assigns unique id.
271 ------------------ ---------- ------- ----------------------------------------
272 cloudType M String "kubernetes". new type
273 ------------------ ---------- ------- ----------------------------------------
274 cloudRegionVersion M String kubernetes version. "v1.9", "v1.8" ...
275 ------------------ ---------- ------- ----------------------------------------
276 ownerDefinedType O String None. (not specified)
277 ------------------ ---------- ------- ----------------------------------------
278 cloudZone O String None. (not speicfied)
279 as kubernetes doesn't have notion of
280 zone.
281 ------------------ ---------- ------- ----------------------------------------
282 complexName O String None. (not specified)
283 as kubernetes doesn't have notion of
284 complex.
285 ------------------ ---------- ------- ----------------------------------------
286 cloudExtraInfo O String json string(dictionary) for necessary
287 info. For now "{}" empty dictionary.
288 For helm support, URL for tiller server
289 is stored.
290 ------------------ ---------- ------- ----------------------------------------
291 vimAuthInfos M [Obj] Auth information of Cloud
292 list of authInfoItem which is described
293 below.
294 ================== ========== ======= ========================================
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800295
296There are several constraints/assumptions on cloudOwner and
297cloudRegionId. `cloud-region`_ . For k8s, cloudRegionId is (ab)used to
298specify k8s cluster instance. ONAP admin has to assign unique id for
299cloudRegionId as id for k8s cluster instance.
300
301NOTE: complexName: this will be revised post-Beijing. "complex" is used to
302specify (latitude, longitude) of a data center location for the purpose of
303homing optimization. If those values can be obtained somehow, this should
304be populated.
305
306authInfoItem
307
308Basic authentication is used for k8s api server.
309
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800310::
311
312 -------------- --------- ------- -------------------------------------------
313 Attribute Qualifier Content Description
314 ============== ========= ======= ===========================================
315 cloudDomain M String "kubernetes" as this doesn't apply.
316 -------------- --------- ------- -------------------------------------------
317 userName M String User name
318 -------------- --------- ------- -------------------------------------------
319 password M String Password
320 -------------- --------- ------- -------------------------------------------
321 authUrl M String URL for kubernetes API server
322 -------------- --------- ------- -------------------------------------------
323 sslCacert O String ca file content if enabled ssl on
324 kubernetes API server
325 -------------- --------- ------- -------------------------------------------
326 sslInsecure O Boolean Whether to verify VIM's certificate
327 ============== ========= ======= ===========================================
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800328
329NOTE: For some issues `issue23`_, ESR should provide authenticating by
330bearer token for Kubernetes cluster if possible beside basic authentication.
331Those extra value will be stored in cloudExtraInfo. This is stretched goal.
332
333
334On boarding/packaging/instantiation
335===================================
336
337We shouldn't change the current existing work flow.
338In short term: Use additional node type/capability types etc.
339In longer term way: Follow ONAP community directoin. At the moment, work
340with TOSCA community to add additional node type to express k8s.
341
342NOTE: this packaging is temporally work around until ONAP modelling
343and multicloud model driven API are available. Post Beijing release
344packaging will be revised to follow ONAP modeling and multicloud model
345driven API.
346
347Packaging and on-boarding
348-------------------------
349
350Reuse CASR so that the existing work flow doesn't need change. For
351Beijing CSAR is used with its own TOSCA node definition. In longer
352term, once multicloud project has model driven API, it will be followed
353to align with modeling and SO.
354
355TOSCA node definitions
356-----------------------
357
358Introduce new nodes to wrap k8s ingredients(k8s yaml, helm etc.) These
359TOSCA node definitions are short term work around to re-use the existing
360component/workflow until model driven API is defined/implemented.
361For Beijing, human will write this TOSCA by hands for PoC. Post Beijing,
362packaging needs to be revised to align with modeling and SO. Also SDC,
363VNF-SDK need to be addressed for creation.
364
365* onap.multicloud.nodes.kubernetes.proxy
366
367 * node definitions
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800368
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800369 ::
370
371 data_types:
372 onap.multicloud.container.kubernetes.proxy.nodes.resources_yaml:
373 properties:
374 name:
375 type: string
376 description: >
377 Name of application
378 path:
379 type: string
380 description: >
381 Paths to kubernetes yaml file
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800382
383For VNFs that are packages as Helm package there would be only one
384TOSCA node in the TOSCA template which would have reference to the
385Helm package.
386
387* onap.multicloud.nodes.kubernetes.helm
388
389 * node definitions
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800390
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800391 ::
392
393 data_types:
394 onap.multicloud.container.kubernetes.helm.nodes.helm_package:
395 properties:
396 name:
397 type: string
398 description: >
399 Name of application
400 path:
401 type: string
402 description: >
403 Paths to Helm package file
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800404
405This TOSCA node definitions wrap kubernetes yaml file or helm chart.
406cloudify.nodes.Kubernetes isn't reused in order to avoid definition conflict.
407
408Instantiation
409-------------
410
411SO ARIA adaptor can be used. (with twist to have SO to talk to
412multicloud k8s plugin instead of ARIA) Instantiation so that SO
413can talk to multicloud k8s plugin.
414NOTE: This is temporally work around for Beijing release. Post Beijing, this
415needs to be revised.
416
417work flow
418---------
419
420With Amsteldam Release, SO has ARIA adaptor which talks to ARIA orchestrator.
421https://wiki.onap.org/download/attachments/16002054/Model%20Driven%20Service%20Orchestration%20-%20SO%20State%20of%20the%20Union.pptx
422
423The work flow looks like follows::
424
425 user request to instantiate VNF
426 |
427 +--------------|-------+
428 | SO | |
429 | V |
430 | +------------------+ |
431 | | SO: ARIA adaptor | |
432 | +------------+-----+ |
433 +--------------|-------+
434 | CASR is sent
435 |
436 +--------------|---------+
437 | ARIA | |
438 | V |
439 | +--------------------+ |
440 | | multicloud plugin | | template as TOSCA artifact is
441 | +------------+-------+ | extracted and build requests to
442 +--------------|---------+ multicloud
443 |
444 |
445 +--------------|-------+
446 | multicloud | |
447 | V |
448 | +------------------+ |
449 | | openstack plugin | |
450 | +------------+-----+ |
451 +--------------|-------+
452 | openstack request
453 |
454 V
455 +----------------------+
456 | openstack |
457 +----------------------+
458
459
460This will be twisted by configuration so that SO can talks to
461multicloud k8s plugin::
462
463 user request to instantiate VNF
464 |
465 +--------------|-------+
466 | SO | |
467 | V |
468 | +------------------+ |
469 | | SO: ARIA adaptor | | configuration is twisted to call
470 | +------------+-----+ | multicloud k8s API
471 +--------------|-------+
472 | CSAR or TGZ
473 |
474 +--------------|-------+
475 | multicloud | |
476 | V |
477 | +------------------+ | handle CSAR or TGZ (Helm Charts) file
478 | | k8s plugin | | e.g. extract k8s yaml from CSAR, and
479 | +------------+-----+ | pass through requests to k8s/Helm API
480 +--------------|-------+
481 | k8s/Helm request
482 |
483 V
484 +----------------------+
485 | k8s/Helm API server |
486 +----------------------+
487
488
489NOTE: In this work flow. only the northbound deployment API endpoint is needed
490for VNF deployment. LCM APIs are only needed for lifecycle management. Other
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800491internal APIs, e.g. k8s YAML API may be needed only for internal
492implementation.
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800493
494SO ARIA multicloud plugin needs to be twisted to call k8s plugin.
495
496The strategy is to keep the existing design of ONAP or to follow
497agreed design.
498The key point of The interaction between SO and multicloud is
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800499
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800500* SO decomposes VNFD/NSD into single atomic resource
501 (e.g. VNF-C corresponding to single VM or single container/pod)
502 and send requests to create each resources via deployment API.
503* multicloud accepts each request for single atomic resource and
504 create single resource(e.g. VM or container/pod)
505* multicloud doesn't do resource decomposition. The decomposition is task
506 of SO.
507
508API work flow example and k8s API
509---------------------------------
510* register k8s cluster to A&AI ESR
511 <cloud-id> is obtained
512* ONAP north bound components generates a TOSCA template targeted for k8s.
513* SO calls Multicloud deployment API and passes the entire BluePrint(as CSAR or
514 TGZ) to k8s plugin, e.g.:
515 POST https://msb.onap.org:80/api/multicloud/v0/<cloud-id>/package
516* k8s plugin handles the CSAR or TGZ accordingly and talks to k8s API Server
517 or Helm Tiller Server to deploy containerized VNF
518 POST <k8s api server>://api/v1/namespaces/{namespace}/pods
519 to create pods. then <pod id> is obtained
520* DELETE https://msb.onap.org:80/api/multicloud/v0/<cloud-id>/proxy/api/v1/namespaces/{namespace}/pods/<pod id>
521 to destroy pod
522* to execute script inside pod, the following URL can be used.
523 POST /api/v1/namespaces/{namespace}/pods/{name}/exec
524
525
526Affected Projects and impact
527============================
528
529A&AI and ESR
530------------
531new type to represent k8s/container for cloud infrastructure will
532be introduced as work around. Post Beijing official value will be
533discussed for inclusion.
534
535OOF
536---
537Policy matching is done by OOF.
538For Beijing. Enhancement to policy is stretched goal.
539Decomposing service design(NSD, VNFD) from VNF package is done by SO
540with OOF(homing)
541
542SO
543--
544ARIA adaptor is re-used with config tweak to avoid modification
545
546multicloud
547----------
548new k8s plugin will be introduced. The details are discussed in this
549documentation you're reading right now.
550
551
552Kubernetes cluster authentication
553=================================
554For details of k8s authentication, please refer to
555https://kubernetes.io/docs/admin/authentication
556
557Because Kubernetes cluster installation is not mentioned, we should
558treat all users as normal users when authenticate to
559Kubernetes VIM. There are several ways to authenticate Kubernetes
560cluster. For Beijing release, basic authentication will be supported.
561username and password are stored in ESR.
562
563
564References
565==========
566Past presentations/proposals
567----------------------------
568.. _Munish proposal: https://schd.ws/hosted_files/onapbeijing2017/dd/Management%20of%20Cloud%20Native%20VNFs%20with%20ONAP%20PA5.pptx
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800569.. _Isaku proposal: https://schd.ws/hosted_files/onapbeijing2017/9d/onap-kubernetes-arch-design-proposal.pdf
570.. _Bin Hu proposal: https://wiki.onap.org/download/attachments/16007890/ONAP-SantaClara-BinHu-final.pdf?version=1&modificationDate=1513558701000&api=v2
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800571
572ONAP components
573---------------
574.. _ESR: Extenral System Register https://wiki.onap.org/pages/viewpage.action?pageId=11930343#A&AI:ExternalSystemOperationAPIDefinition-VIM
575.. _AAI: Active and Available Inventory https://wiki.onap.org/display/DW/Active+and+Available+Inventory+Project
576.. _OOM: ONAP Operations Manager https://wiki.onap.org/display/DW/ONAP+Operations+Manager+Project
577.. _ONAPREST: RESTful API Design Specification https://wiki.onap.org/display/DW/RESTful+API+Design+Specification
578
579kubernetes
580----------
581.. _kubernetes-python-client: Kubernetes python client https://github.com/kubernetes-client/python
582
583.. _issue23: https://github.com/kubernetes/kubeadm/issues/23
584
585misc
586----
587.. _cloud-region: How to add a new cloud region and some thoughts https://wiki.onap.org/download/attachments/25429038/HowToAddNewCloudRegionAndThoughts.pdf
588
589
590Contributors
591============
592* Isaku Yamahata <isaku.yamahata@intel.com> <isaku.yamahata@gmail.com>
593* Bin Hu <bh526r@att.com>
594* Munish Agarwal <munish.agarwal@ericsson.com>
595* Phuoc Hoang <phuoc.hc@dcn.ssu.ac.kr>
596
597
598APPENDIX
599========
600This section is informative. This is out of Beijing scope and will be
601revised after Beijing.
602The purpose of this appendix is to help readers to understand this
603proposal by giving future direction and considerations.
604At some point, this appendix will be separated out into its own document
605for long-term right design.
606
607Model driven API and kubernetes model
608-------------------------------------
609Currently the discussion on model driver API is on going. Once it's usable,
610it will be followed and the above experimental API/code will be revised.
611
612The eventual work flow looks like as follows::
613
614 user request to instantiate VNF/NS
615 |
616 V
617 +----------------------+ +-----+
618 | SO |-------->| OOF | <--- policy to use
619 | |<--------| | CoE instead of VM
620 | | +-----+ from A&AI
621 | +------------------+ |
622 | | SO: adaptor for | | SO decomposes VNFD/NSD into atomic
623 | | multicloud model | | resources(VDUs for VNF-C) with asking OOF
624 | | driven API | | for placement. then SO builds up
625 | +------------+-----+ | requests to multicoud for instantiation.
626 +--------------|-------+
627 |
628 |
629 +--------------|-------+
630 | multicloud | | So multicloud accepts request for single
631 | V | resource of VDU which corresponds to
632 | +------------------+ | VNF-C. which is mapped to single
633 | | model driven API | | container/pod. multicloud doesn't
634 | +------------+-----+ | decompose VDU into multiple containers.
635 | | | CoE doesn't change such work flow.
636 | V |
637 | +------------------+ |
638 | | k8s plugin | | convert request(VDU of VNF-C) into
639 | +------------+-----+ | kubernetes
640 +--------------|-------+
641 | k8s request
642 |
643 V
644 +----------------------+
645 | kubernetes |
646 +----------------------+
647
648
649Modeling/TOSCA to kubernetes conversion
650---------------------------------------
651In this section, conversion from TOSCA to kubernetes is discussed
652so that reader can get idea for future direction.
653
654Once ONAP information/data model is usable, similar conversion is possible.
655The followings are only examples. More node definitions would be considered
656as necessary::
657
658 TOSCA node definition k8s resource
659 ============================ ================================
660 tosca.nodes.Compute (bare)single pod
661 vcpu, memory -> k8s resource
662 ---------------------------- --------------------------------
663 tosca.nodes.nfv.VDU.Compute (bare)single pod
664
665
666Hello world example
667-------------------
668This is just to show idea.
669This example is very early phase and there are hard-coded values.
670
671
672* TOSCA hello world
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800673 ::
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800674
675 topology_template:
676 node_templates:
677 my_server:
678 type: tosca.nodes.Compute
679 capabilities:
680 # Host container properties
681 host:
682 properties:
683 num_cpus: 2
684 disk_size: 10 GB
685 mem_size: 512 MB
686 # Guest Operating System properties
687 os:
688 properties:
689 # host Operating System image properties
690 architecture: x86_64
691 type: Linux
692 distribution: RHEL
693 version: 6.5
694
695
696* converted k8s yaml
Ethan Lynnb3e79cc2018-06-05 17:26:55 +0800697 ::
Isaku Yamahata1f7ba512018-02-01 10:08:43 -0800698
699 $ PYTHONPATH=. python -m tosca_translator.shell -d --debug --template-file tosca_translator/tests/data/tosca_helloworld.yaml
700 api_version: apps/v1beta1
701 kind: Deployment
702 metadata:
703 labels: {name: my_server}
704 spec:
705 replicas: 1
706 template:
707 metadata:
708 labels: {name: my_server}
709 spec:
710 containers:
711 - image: ubuntu
712 name: my_server
713 resources:
714 limits: {cpu: 2, ephemeral-storage: 10 GB, memory: 512 MB}
715 requests: {cpu: 2, ephemeral-storage: 10 GB, memory: 512 MB}