blob: 4d90a8c10cc2cb9011a38c7a9549c23e8e05c026 [file] [log] [blame]
Haibin Huang5b0faa52019-11-07 10:43:33 +08001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright (c) 2019 Intel, Inc.
4
5=================================================
6MultiCloud for k8s HPA Discovery And Registration
7=================================================
8Discover HPA capability and register it to A&AI
9
10Problem Description
11===================
12
13Kubernetes clusters using ONAP Multicloud K8s Plugin Project for R4/R5 do not report hardware
14features to A&AI. Consequently during the CNF/VNF life cycle CNFs/VNFs that require or recommend
15specific hardware during instantiation cannot dynamically reach the correct cluster and node that
16provides the needed hardware capabilities.
17
18
19Propose Change
20==============
21
22Cluster Registration FLOW
23-------------------------
24#. Cluster is deployed.
25#. K8s registration agent is deployed on cluster.
26#. K8s registration agent gathers features and cluster info.
27#. K8s registration agent registers with K8s scheduler with labels identifying it's capabilities.
28#. K8s Scheduler hook gives HPA Placement Plugin hardware features.
29#. HPA Placement Plugins stores features in mongoDB.
30
31AAI Registration
32----------------
33#. CLI registers cluster with K8s plugin.
34#. Registration asks HPA Placement for cluster features.
35#. HPA Placement gets cluster features from mongoDB.
36#. HPA Placement plugin returns map of nodes/features to registration.
37#. Registration module munges features into tenant/flavors updates AAI.
38
39Converting node feature label to flavor properties
40^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41
42Node feature label::
43
44 feature.node.kubernetes.io/network-sriov.capable=True
45 feature.node.kubernetes.io/network-sriov.configured=True
46 feature.node.kubernetes.io/pci-1200_8086.present=True
47
48Comments: The other parameter we can set default because node feature label can not provide.
49
50
51Flavor properties::
52
53 +-----------------------------------------------------+-------------+
54 | Field | Value |
55 +-----------------------------------------------------+-------------+
56 | OS-FLV-DISABLED:disabled | False |
57 | OS-FLV-DISABLED:ephemeral | 0 |
58 | feature.node.kubernetes.io/network-sriov.capable | True |
59 | feature.node.kubernetes.io/network-sriov.configured | True |
60 | feature.node.kubernetes.io/pci-1200_8086.present | True |
61 | disk | 1 |
62 | id | 1 |
63 | name | k8s_sriov_1 |
64 | ram | 512 |
65 | vcpus | 1 |
66 +-----------------------------------------------------+-------------+
67
68Add API for K8s Plugin
69^^^^^^^^^^^^^^^^^^^^^^
70API V0 URL: POST http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry
71API V1 URL: POST http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry
72
73Request Body:
74>>>>>>>>>>>>>
75::
76
77 {
78 }
79
80Response:
81>>>>>>>>>
82
83Response Codes
84::::::::::::::
85Success
86.......
87
88+--------------------+----------------------------------------------------------------------+
89| Code | Reason |
90+====================+======================================================================+
91| 202 - ACCEPTED | Discover HPA and successfully register it |
92+--------------------+----------------------------------------------------------------------+
93
94Error
95.....
96
97+----------------------------+--------------------------------------------------------------+
98| Code | Reason |
99+============================+==============================================================+
100| 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid. |
101+----------------------------+--------------------------------------------------------------+
102
103
104Response Body
105:::::::::::::
106::
107
108 {
109 }
110
111API V0 URL: GET http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry
112API V1 URL: GET http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry
113
114Request Body:
115>>>>>>>>>>>>>
116::
117
118 {
119 }
120
121Response:
122>>>>>>>>>
123
124Response Codes
125::::::::::::::
126Success
127.......
128
129+--------------------+----------------------------------------------------------------------+
130| Code | Reason |
131+====================+======================================================================+
132| 202 - ACCEPTED | Discover HPA and successfully register it |
133+--------------------+----------------------------------------------------------------------+
134
135Error
136.....
137
138+----------------------------+--------------------------------------------------------------+
139| Code | Reason |
140+============================+==============================================================+
141| 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid. |
142+----------------------------+--------------------------------------------------------------+
143
144
145Response Body
146:::::::::::::
147::
148
149 {
150 }
151
152
153API V0 URL: DELETE http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry
154API V1 URL: DELETE http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry
155
156Request Body:
157>>>>>>>>>>>>>
158::
159
160 {
161 }
162
163Response:
164>>>>>>>>>
165
166Response Codes
167::::::::::::::
168Success
169.......
170
171+--------------------+----------------------------------------------------------------------+
172| Code | Reason |
173+====================+======================================================================+
174| 204 - NO_CONTENT | Successfully delete HPA information from AAI |
175+--------------------+----------------------------------------------------------------------+
176
177Error
178.....
179
180+----------------------------+--------------------------------------------------------------+
181| Code | Reason |
182+============================+==============================================================+
183| 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid. |
184+----------------------------+--------------------------------------------------------------+
185
186
187Response Body
188:::::::::::::
189::
190
191 {
192 }
193
194Work Items
195==========
196
197#. Work with CLI.
198#. Work with AAI.
199#. Expose API by broker and k8s plugin.
200
201Tests
202=====
203
204#. Unit Tests with tox
205#. Pairwise test with AAI project.
206#. Integration test with vFW HPA test.
207#. CSIT Tests, the input/ouput of broker and k8s plugin see API design above.
208
209Reference
210=========
211https://wiki.onap.org/display/DW/Extending+HPA+for+K8S