Haibin Huang | 5b0faa5 | 2019-11-07 10:43:33 +0800 | [diff] [blame] | 1 | .. 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 | =================================================
|
| 6 | MultiCloud for k8s HPA Discovery And Registration
|
| 7 | =================================================
|
| 8 | Discover HPA capability and register it to A&AI
|
| 9 |
|
| 10 | Problem Description
|
| 11 | ===================
|
| 12 |
|
| 13 | Kubernetes clusters using ONAP Multicloud K8s Plugin Project for R4/R5 do not report hardware
|
| 14 | features to A&AI. Consequently during the CNF/VNF life cycle CNFs/VNFs that require or recommend
|
| 15 | specific hardware during instantiation cannot dynamically reach the correct cluster and node that
|
| 16 | provides the needed hardware capabilities.
|
| 17 |
|
| 18 |
|
| 19 | Propose Change
|
| 20 | ==============
|
| 21 |
|
| 22 | Cluster 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 |
|
| 31 | AAI 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 |
|
| 39 | Converting node feature label to flavor properties
|
| 40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| 41 |
|
| 42 | Node 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 |
|
| 48 | Comments: The other parameter we can set default because node feature label can not provide.
|
| 49 |
|
| 50 |
|
| 51 | Flavor 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 |
|
| 68 | Add API for K8s Plugin
|
| 69 | ^^^^^^^^^^^^^^^^^^^^^^
|
| 70 | API V0 URL: POST http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry
|
| 71 | API V1 URL: POST http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry
|
| 72 |
|
| 73 | Request Body:
|
| 74 | >>>>>>>>>>>>>
|
| 75 | ::
|
| 76 |
|
| 77 | {
|
| 78 | }
|
| 79 |
|
| 80 | Response:
|
| 81 | >>>>>>>>>
|
| 82 |
|
| 83 | Response Codes
|
| 84 | ::::::::::::::
|
| 85 | Success
|
| 86 | .......
|
| 87 |
|
| 88 | +--------------------+----------------------------------------------------------------------+
|
| 89 | | Code | Reason |
|
| 90 | +====================+======================================================================+
|
| 91 | | 202 - ACCEPTED | Discover HPA and successfully register it |
|
| 92 | +--------------------+----------------------------------------------------------------------+
|
| 93 |
|
| 94 | Error
|
| 95 | .....
|
| 96 |
|
| 97 | +----------------------------+--------------------------------------------------------------+
|
| 98 | | Code | Reason |
|
| 99 | +============================+==============================================================+
|
| 100 | | 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid. |
|
| 101 | +----------------------------+--------------------------------------------------------------+
|
| 102 |
|
| 103 |
|
| 104 | Response Body
|
| 105 | :::::::::::::
|
| 106 | ::
|
| 107 |
|
| 108 | {
|
| 109 | }
|
| 110 |
|
| 111 | API V0 URL: GET http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry
|
| 112 | API V1 URL: GET http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry
|
| 113 |
|
| 114 | Request Body:
|
| 115 | >>>>>>>>>>>>>
|
| 116 | ::
|
| 117 |
|
| 118 | {
|
| 119 | }
|
| 120 |
|
| 121 | Response:
|
| 122 | >>>>>>>>>
|
| 123 |
|
| 124 | Response Codes
|
| 125 | ::::::::::::::
|
| 126 | Success
|
| 127 | .......
|
| 128 |
|
| 129 | +--------------------+----------------------------------------------------------------------+
|
| 130 | | Code | Reason |
|
| 131 | +====================+======================================================================+
|
| 132 | | 202 - ACCEPTED | Discover HPA and successfully register it |
|
| 133 | +--------------------+----------------------------------------------------------------------+
|
| 134 |
|
| 135 | Error
|
| 136 | .....
|
| 137 |
|
| 138 | +----------------------------+--------------------------------------------------------------+
|
| 139 | | Code | Reason |
|
| 140 | +============================+==============================================================+
|
| 141 | | 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid. |
|
| 142 | +----------------------------+--------------------------------------------------------------+
|
| 143 |
|
| 144 |
|
| 145 | Response Body
|
| 146 | :::::::::::::
|
| 147 | ::
|
| 148 |
|
| 149 | {
|
| 150 | }
|
| 151 |
|
| 152 |
|
| 153 | API V0 URL: DELETE http://{{MSB_IP}}:{{MSB_PORT}}/api/v0/multicloud-k8s/{{cloud-owner}}_{{cloud-region-id}}/registry
|
| 154 | API V1 URL: DELETE http://{{MSB_IP}}:{{MSB_PORT}}/api/v1/multicloud-k8s/{{cloud-owner}}/{{cloud-region-id}}/registry
|
| 155 |
|
| 156 | Request Body:
|
| 157 | >>>>>>>>>>>>>
|
| 158 | ::
|
| 159 |
|
| 160 | {
|
| 161 | }
|
| 162 |
|
| 163 | Response:
|
| 164 | >>>>>>>>>
|
| 165 |
|
| 166 | Response Codes
|
| 167 | ::::::::::::::
|
| 168 | Success
|
| 169 | .......
|
| 170 |
|
| 171 | +--------------------+----------------------------------------------------------------------+
|
| 172 | | Code | Reason |
|
| 173 | +====================+======================================================================+
|
| 174 | | 204 - NO_CONTENT | Successfully delete HPA information from AAI |
|
| 175 | +--------------------+----------------------------------------------------------------------+
|
| 176 |
|
| 177 | Error
|
| 178 | .....
|
| 179 |
|
| 180 | +----------------------------+--------------------------------------------------------------+
|
| 181 | | Code | Reason |
|
| 182 | +============================+==============================================================+
|
| 183 | | 500 - INTERAL_SERVER_ERROR | Some content in the request was invalid. |
|
| 184 | +----------------------------+--------------------------------------------------------------+
|
| 185 |
|
| 186 |
|
| 187 | Response Body
|
| 188 | :::::::::::::
|
| 189 | ::
|
| 190 |
|
| 191 | {
|
| 192 | }
|
| 193 |
|
| 194 | Work Items
|
| 195 | ==========
|
| 196 |
|
| 197 | #. Work with CLI.
|
| 198 | #. Work with AAI.
|
| 199 | #. Expose API by broker and k8s plugin.
|
| 200 |
|
| 201 | Tests
|
| 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 |
|
| 209 | Reference
|
| 210 | =========
|
| 211 | https://wiki.onap.org/display/DW/Extending+HPA+for+K8S
|