Crreate Register Module in k8s plugin 82/98082/1
authorHaibin Huang <haibin.huang@intel.com>
Thu, 7 Nov 2019 02:43:33 +0000 (10:43 +0800)
committerHaibin Huang <haibin.huang@intel.com>
Thu, 7 Nov 2019 02:46:07 +0000 (10:46 +0800)
Issue-ID: MULTICLOUD-740
Signed-off-by: Haibin Huang <haibin.huang@intel.com>
Change-Id: I1f7eb11af787fbe680afd1bcf267f378476d8981

docs/specs/multicloud4k8s-hpa-discovery.rst [new file with mode: 0644]

diff --git a/docs/specs/multicloud4k8s-hpa-discovery.rst b/docs/specs/multicloud4k8s-hpa-discovery.rst
new file mode 100644 (file)
index 0000000..4d90a8c
--- /dev/null
@@ -0,0 +1,211 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
+.. http://creativecommons.org/licenses/by/4.0\r
+.. Copyright (c) 2019 Intel, Inc.\r
+\r
+=================================================\r
+MultiCloud for k8s HPA Discovery And Registration\r
+=================================================\r
+Discover HPA capability and register it to A&AI\r
+\r
+Problem Description\r
+===================\r
+\r
+Kubernetes clusters using ONAP Multicloud K8s Plugin Project for R4/R5 do not report hardware\r
+features to A&AI. Consequently during the CNF/VNF life cycle CNFs/VNFs that require or recommend\r
+specific hardware during instantiation cannot dynamically reach the correct cluster and node that\r
+provides the needed hardware capabilities.\r
+\r
+\r
+Propose Change\r
+==============\r
+\r
+Cluster Registration FLOW\r
+-------------------------\r
+#. Cluster is deployed.\r
+#. K8s registration agent is deployed on cluster.\r
+#. K8s registration agent gathers features and cluster info.\r
+#. K8s registration agent registers with K8s scheduler with labels identifying it's capabilities.\r
+#. K8s Scheduler hook gives HPA Placement Plugin hardware features.\r
+#. HPA Placement Plugins stores features in mongoDB.\r
+\r
+AAI Registration\r
+----------------\r
+#. CLI registers cluster with K8s plugin.\r
+#. Registration asks HPA Placement for cluster features.\r
+#. HPA Placement gets cluster features from mongoDB.\r
+#. HPA Placement plugin returns map of nodes/features to registration.\r
+#. Registration module munges features into tenant/flavors updates AAI.\r
+\r
+Converting node feature label to flavor properties\r
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r
+\r
+Node feature label::\r
+    \r
+    feature.node.kubernetes.io/network-sriov.capable=True\r
+    feature.node.kubernetes.io/network-sriov.configured=True\r
+    feature.node.kubernetes.io/pci-1200_8086.present=True\r
+\r
+Comments: The other parameter we can set default because node feature label can not provide.\r
+\r
+\r
+Flavor properties::\r
+    \r
+    +-----------------------------------------------------+-------------+\r
+    | Field                                               | Value       |\r
+    +-----------------------------------------------------+-------------+\r
+    | OS-FLV-DISABLED:disabled                            | False       |\r
+    | OS-FLV-DISABLED:ephemeral                           | 0           |\r
+    | feature.node.kubernetes.io/network-sriov.capable    | True        |\r
+    | feature.node.kubernetes.io/network-sriov.configured | True        |\r
+    | feature.node.kubernetes.io/pci-1200_8086.present    | True        |\r
+    | disk                                                | 1           |\r
+    | id                                                  | 1           |\r
+    | name                                                | k8s_sriov_1 |\r
+    | ram                                                 | 512         |\r
+    | vcpus                                               | 1           |\r
+    +-----------------------------------------------------+-------------+\r
+\r
+Add API for K8s Plugin\r
+^^^^^^^^^^^^^^^^^^^^^^\r
+API V0 URL: POST http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry\r
+API V1 URL: POST http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry\r
+\r
+Request Body:\r
+>>>>>>>>>>>>>\r
+::\r
+\r
+  {\r
+  }\r
+\r
+Response:\r
+>>>>>>>>>\r
+\r
+Response Codes\r
+::::::::::::::\r
+Success\r
+.......\r
+\r
++--------------------+----------------------------------------------------------------------+\r
+| Code               | Reason                                                               |\r
++====================+======================================================================+\r
+| 202 - ACCEPTED     | Discover HPA and successfully register it                            |\r
++--------------------+----------------------------------------------------------------------+\r
+\r
+Error\r
+.....\r
+\r
++----------------------------+--------------------------------------------------------------+\r
+| Code                       | Reason                                                       |\r
++============================+==============================================================+\r
+| 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid.                     |\r
++----------------------------+--------------------------------------------------------------+\r
+\r
+\r
+Response Body\r
+:::::::::::::\r
+::\r
+\r
+    {\r
+    }\r
+       \r
+API V0 URL: GET http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry\r
+API V1 URL: GET http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry\r
+\r
+Request Body:\r
+>>>>>>>>>>>>>\r
+::\r
+\r
+  {\r
+  }\r
+\r
+Response:\r
+>>>>>>>>>\r
+\r
+Response Codes\r
+::::::::::::::\r
+Success\r
+.......\r
+\r
++--------------------+----------------------------------------------------------------------+\r
+| Code               | Reason                                                               |\r
++====================+======================================================================+\r
+| 202 - ACCEPTED     | Discover HPA and successfully register it                            |\r
++--------------------+----------------------------------------------------------------------+\r
+\r
+Error\r
+.....\r
+\r
++----------------------------+--------------------------------------------------------------+\r
+| Code                       | Reason                                                       |\r
++============================+==============================================================+\r
+| 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid.                     |\r
++----------------------------+--------------------------------------------------------------+\r
+\r
+\r
+Response Body\r
+:::::::::::::\r
+::\r
+\r
+    {\r
+    }\r
+       \r
+       \r
+API V0 URL: DELETE http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry\r
+API V1 URL: DELETE http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry\r
+\r
+Request Body:\r
+>>>>>>>>>>>>>\r
+::\r
+\r
+  {\r
+  }\r
+\r
+Response:\r
+>>>>>>>>>\r
+\r
+Response Codes\r
+::::::::::::::\r
+Success\r
+.......\r
+\r
++--------------------+----------------------------------------------------------------------+\r
+| Code               | Reason                                                               |\r
++====================+======================================================================+\r
+| 204 - NO_CONTENT   | Successfully delete HPA information from AAI                         |\r
++--------------------+----------------------------------------------------------------------+\r
+\r
+Error\r
+.....\r
+\r
++----------------------------+--------------------------------------------------------------+\r
+| Code                       | Reason                                                       |\r
++============================+==============================================================+\r
+| 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid.                     |\r
++----------------------------+--------------------------------------------------------------+\r
+\r
+\r
+Response Body\r
+:::::::::::::\r
+::\r
+\r
+    {\r
+    }\r
+\r
+Work Items\r
+==========\r
+\r
+#. Work with CLI.\r
+#. Work with AAI.\r
+#. Expose API by broker and k8s plugin.\r
+\r
+Tests\r
+=====\r
+\r
+#. Unit Tests with tox\r
+#. Pairwise test with AAI project.\r
+#. Integration test with vFW HPA test.\r
+#. CSIT Tests, the input/ouput of broker and k8s plugin see API design above.\r
+\r
+Reference\r
+=========\r
+https://wiki.onap.org/display/DW/Extending+HPA+for+K8S\r