1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2017 AT&T Intellectual Property. All rights reserved.
6 Adding a Kubernetes (K8S) Cloud Site to ONAP
7 ============================================
9 The following guide describes how to configure ONAP to be able to instantiate
10 a service in a new cloud site based on Kubernetes.
12 There are three major steps to configure a new k8s cloud site.
14 * Declare the new cloud site within SO
15 * Declare the new cloud site (or new Region Name) in AAI
16 * Multicloud registration and declaration
18 In this guideline the following parameters/values will be used
20 * Complex Name: My_Complex
21 * Region Name: K8S_Cloud_Region_Name
22 * Openstack Tenant Region Value: TenantRegion
23 * Cloud Owner: MyCompanyName
25 STEP 1 : Declare the new cloud site within SO
26 ---------------------------------------------
28 Add new k8s cloud site in mariadb database
29 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 In a Unix Terminal, to get the pod id that is providing
36 kubectl -n onap get pod | grep mariadb-galera
38 To connect to this pod
39 (in this example, the SO pod id is "onap-mariadb-galera-mariadb-galera-0"):
43 kubectl -n onap exec -ti onap-mariadb-galera-mariadb-galera-0 sh
45 Then modify the data in the MariaDB:
49 mysql --user=so_admin --password=so_Admin123
51 INSERT INTO cloud_sites(ID, REGION_ID, IDENTITY_SERVICE_ID, CLOUD_VERSION, CLLI, ORCHESTRATOR) values("K8S_Cloud_Region_Name", "K8S_Cloud_Region_Name", "DEFAULT_KEYSTONE", "2.5", "My_Complex", "multicloud");
53 ONAP SO VNF Adapter Rest API endpoint version shall be set to version "v2"
54 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 to find the right config map name:
62 kubectl -n onap get configmap | grep so-so-bpmn-infra-app-configmap
65 to edit and change the configmap:
69 kubectl -n onap edit configmap onap-so-so-bpmn-infra-app-configmap
71 in the section "vnf", modify the rest endpoint:
76 endpoint: http://so-openstack-adapter.onap:8087/services/VnfAdapter
78 - endpoint: http://so-openstack-adapter.onap:8087/services/rest/v1/vnfs
79 + endpoint: http://so-openstack-adapter.onap:8087/services/rest/v2/vnfs
82 endpoint: http://so-openstack-adapter.onapg:8087/services/rest/v1/volume-groups
85 Having modified the configmap, it is necessary to delete the pod bpmn-infra in
86 order it takes the modification into account.
88 to find the right pod name:
92 kubectl get po -n onap |grep bpmn-infra
95 You need to find the pod that is similar to the following pod id:
97 "onap-so-so-bpmn-infra-79fdf6f9d5-t8qr4"
104 kubectl -n onap delete onap-so-so-bpmn-infra-79fdf6f9d5-t8qr4
107 Then, wait for the pod to restart. To check:
111 kubectl -n onap get po | grep so-so
113 STEP 2 : Declare the new cloud site in AAI
114 ------------------------------------------
116 Declare a Complex in ONAP AAI
117 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120 A Cloud Site is located in a Building called "Complex" object
121 in ONAP AAI datamodel.
123 AAI REST API is used to declare the complex object.
125 Here is an example using "curl" tool to send the API request.
127 The new Complex is named "My_Complex" in this example.
133 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/cloud-infrastructure/complexes/complex/My_Complex \
134 -H 'Accept: application/json' \
135 -H 'Authorization: Basic QUFJOkFBSQ==' \
136 -H 'Cache-Control: no-cache' \
137 -H 'Content-Type: application/json' \
138 -H 'Real-Time: true' \
139 -H 'X-FromAppId: jimmy-postman' \
140 -H 'X-TransactionId: 9999' \
142 "physical-location-id": "My_Complex",
143 "data-center-code": "example-data-center-code-val-5556",
144 "complex-name": "My_Complex",
145 "identity-url": "example-identity-url-val-56898",
146 "physical-location-type": "example-physical-location-type-val-7608",
147 "street1": "example-street1-val-34205",
148 "street2": "example-street2-val-99210",
150 "state": "example-state-val-59487",
151 "postal-code": "100000",
152 "country": "example-country-val-94173",
153 "region": "example-region-val-13893",
154 "latitude": "39.9042",
155 "longitude": "106.4074",
156 "elevation": "example-elevation-val-30253",
157 "lata": "example-lata-val-46073"
161 Check the Complexes in ONAP AAI:
166 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/cloud-infrastructure/complexes \
167 -H 'Accept: application/json' \
168 -H 'Authorization: Basic QUFJOkFBSQ==' \
169 -H 'X-FromAppId: AAI' \
170 -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
171 -H 'cache-control: no-cache' -k
173 Declare a Cloud Site in ONAP AAI
174 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176 To declare a Cloud Site, you need to use the AAI REST API.
178 The new Cloud site is named "K8S_Cloud_Region_Name" in this example.
180 The Cloud Owner is named "MyCompanyName" in this example.
182 parameter "complex-name" relates to the Complex you previously declared.
184 parameter "cloud-type" takes the value "k8s"
186 The following parameters specifying openstack cloud tenant are set with dummy
189 * parameter "cloud-extra-info"
190 * parameter "esr-system-info-list"
192 The association to the complex object is set in the curl request to create the
198 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/MyCompanyName/K8S_Cloud_Region_Name \
199 -H 'Accept: application/json' \
200 -H 'Authorization: Basic QUFJOkFBSQ==' \
201 -H 'Cache-Control: no-cache' \
202 -H 'Content-Type: application/json' \
203 -H 'Postman-Token: 8b9b95ae-91d6-4436-90fa-69cb4d2db99c' \
204 -H 'Real-Time: true' \
205 -H 'X-FromAppId: jimmy-postman' \
206 -H 'X-TransactionId: 9999' \
208 "cloud-owner": "MyCompanyName",
209 "cloud-region-id": "K8S_Cloud_Region_Name",
211 "owner-defined-type": "t1",
212 "cloud-region-version": "1.0",
213 "complex-name": "My_Complex",
214 "cloud-zone": "CloudZone",
215 "sriov-automation": false,
217 "cloud-extra-info":"{\"openstack-region-id\":\"TenantRegion\"}"
218 "esr-system-info-list": {
221 "esr-system-info-id": "55f97d59-6cc3-49df-8e69-926565f00066",
222 "service-url": "http://10.12.25.2:5000/v3",
224 "password": "onapdemo",
225 "system-type": "VIM",
226 "ssl-insecure": true,
227 "cloud-domain": "Default",
228 "default-tenant": "OOF",
229 "tenant-id": "6bbd2981b210461dbc8fe846df1a7808",
230 "system-status": "active"
234 "relationship-list": {
237 "related-to": "complex",
238 "relationship-label": "org.onap.relationships.inventory.LocatedIn",
239 "related-link": "/aai/v13/cloud-infrastructure/complexes/complex/My_Complex",
240 "relationship-data": [
242 "relationship-key": "complex.physical-location-id",
243 "relationship-value": "My_Complex"
252 Check the Cloud Site creation in ONAP AAI:
257 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/cloud-infrastructure/cloud-regions \
258 -H 'Accept: application/json' \
259 -H 'Authorization: Basic QUFJOkFBSQ==' \
260 -H 'X-FromAppId: AAI' \
261 -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
262 -H 'cache-control: no-cache' -k
264 STEP 3 : Multicloud registration and declaration
265 ------------------------------------------------
267 Register k8s site in multicloud
268 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270 The k8s site (K8S_Cloud_Region_Name) associated to the cloud owner
271 (MyCompanyName) shall be registered in multicloud.
276 https://msb.api.discovery.simpledemo.onap.org:30283/api/multicloud-titaniumcloud/v1/MyCompanyName/K8S_Cloud_Region_Name/registry \
277 -H 'Accept: application/json' \
278 -H 'Cache-Control: no-cache' \
279 -H 'Content-Type: application/json' -k
282 The registration is successfull if the answer is : 202 Accepted.
284 Looking at the log of windriver multicloud pod, some errors are raised due to
285 the fact that the pod attempts to contact the dummy openstack tenant.
288 kubectl -n onap logs -f onap-multicloud-multicloud-windriver-77dbc6b694-t74qm -c multicloud-windriver
291 Declare k8s connnectivity information in multicloud
292 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
297 https://msb.api.discovery.simpledemo.onap.org:30283/api/multicloud-k8s/v1/v1/connectivity-info \
298 -i -F "metadata=<post.json;type=application/json" \
299 -F file=@config/config -k
301 # Content of post.json
303 "cloud-region" : "K8S_Cloud_Region_Name",
304 "cloud-owner" : "MyCompanyName",
305 "other-connectivity-list" : {
309 #config is the .kube/config file of your k8s cloud environment
311 To check that the connectivity information is correctly applied:
316 https://msb.api.discovery.simpledemo.onap.org:30283/api/multicloud-k8s/v1/v1/connectivity-info/K8S_Cloud_Region_Name -k