Extend K8S and RIC installation instructions
[it/dep.git] / docs / installation-ric.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. ===============LICENSE_START=======================================================
4 .. Copyright (C) 2019-2020 AT&T Intellectual Property
5 .. ===================================================================================
6 .. This documentation file is distributed under the Creative Commons Attribution
7 .. 4.0 International License (the "License"); you may not use this file except in
8 .. compliance with the License.  You may obtain a copy of the License at
9 ..
10 .. http://creativecommons.org/licenses/by/4.0
11 ..
12 .. This file is distributed on an "AS IS" BASIS,
13 .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 .. See the License for the specific language governing permissions and
15 .. limitations under the License.
16 .. ===============LICENSE_END=========================================================
17
18
19 Getting and Preparing Deployment Scripts
20 ----------------------------------------
21
22 Clone the it/dep git repository that has deployment scripts and support files on the target VM. 
23 (You might have already done this in a previous step.)
24
25 ::
26
27   % git clone https://gerrit.o-ran-sc.org/r/it/dep
28
29 Check out the appropriate branch of the repository with the release you want to deploy.
30 For example:
31
32 ::
33
34   % git checkout Amber
35
36 In the RECIPE_EXAMPLE directory, edit the recipe files RIC_INFRA_RECIPE_EXAMPLE and
37 RIC_PLATFORM_RECIPE_EXAMPLE. In particular the following values often need adaptation
38 to local deployments:
39
40 #. Docker registry URL (property "repository"). This is the default source for
41    container images. For example,
42    nexus3.o-ran-sc.org:10004/o-ran-sc is the staging registry and has freshly built images;
43    nexus3.o-ran-sc.org:10002/o-ran-sc is the release registry and has stable images.
44 #. Docker registry credential. This is a name of a Kubernetes credential. Some registries
45    allow anonymous read access, including nexus3.o-ran-sc.org.
46 #. Helm repo and credential. The xApp Manager deploys xApps from charts in this repo.
47    No changes are required here for basic dev testing of platform components.
48 #. Component docker container image repository override and tag.  The recipes specify
49    the docker image to use in terms of name and tag.  These entries also allow override
50    of the default docker registry URL (see above); for example, the default might be the
51    releases registry and then a component under test is deployed from the staging registry.
52
53
54 Deploying the Infrastructure and Platform Groups
55 ------------------------------------------------
56
57 After the recipes are edited, the Near Realtime RIC is ready to be deployed.
58 Perform the following steps in a root shell.
59
60 .. code:: bash
61
62   % sudo -i
63   # cd dep/bin
64   # ./deploy-ric-infra ../RECIPE_EXAMPLE/RIC_INFRA_RECIPE_EXAMPLE
65   # ./deploy-ric-platform ../RECIPE_EXAMPLE/RIC_PLATFORM_RECIPE_EXAMPLE
66
67
68 Checking the Deployment Status
69 ------------------------------
70
71 Now check the deployment status after a short wait. Results similar to the
72 output shown below indicate a complete and successful deployment. Check the
73 STATUS column from both kubectl outputs to ensure that all are either 
74 "Completed" or "Running", and that none are "Error" or "ImagePullBackOff".
75
76 .. code::
77
78   # helm list
79   NAME                   REVISION UPDATED                   STATUS      CHART                   APP VERSION     NAMESPACE
80   r1-a1mediator          1        Tue Nov 26 00:47:12 2019  DEPLOYED    a1mediator-2.0.0        1.0         ricplt
81   r1-appmgr              1        Tue Nov 26 00:47:09 2019  DEPLOYED    appmgr-1.1.0            1.0             ricplt
82   r1-chartmuseum         1        Tue Nov 26 03:16:42 2019  DEPLOYED    chartmuseum-0.0.1   0.1         ricinfra
83   r1-dbaas1              1        Tue Nov 26 00:47:10 2019  DEPLOYED    dbaas1-1.1.0            1.0             ricplt
84   r1-e2mgr               1        Tue Nov 26 00:47:10 2019  DEPLOYED    e2mgr-1.1.0             1.0             ricplt
85   r1-e2term              1        Tue Nov 26 00:47:11 2019  DEPLOYED    e2term-1.1.0            1.0             ricplt
86   r1-extsvcplt           1        Tue Nov 26 00:47:17 2019  DEPLOYED    extsvcplt-0.2.0         1.0             ricplt
87   r1-jaegeradapter       1        Tue Nov 26 00:47:16 2019  DEPLOYED    jaegeradapter-0.1.0     1.0             ricplt
88   r1-kong                1        Tue Nov 26 00:45:36 2019  DEPLOYED    kong-1.0.0              1.0             ricinfra
89   r1-ricaux-credential   1        Tue Nov 26 00:45:42 2019  DEPLOYED    credential-1.1.0        1.0             ricaux
90   r1-ricinfra-credential 1        Tue Nov 26 00:45:43 2019  DEPLOYED    credential-1.1.0        1.0             ricinfra
91   r1-ricplt-credential   1        Tue Nov 26 00:45:42 2019  DEPLOYED    credential-1.1.0        1.0             ricplt
92   r1-ricxapp-credential  1        Tue Nov 26 00:45:42 2019  DEPLOYED    credential-1.1.0        1.0             ricxapp
93   r1-rsm                 1        Tue Nov 26 00:47:15 2019  DEPLOYED    rsm-2.0.6               1.0             ricplt
94   r1-rtmgr               1        Tue Nov 26 00:47:09 2019  DEPLOYED    rtmgr-1.1.0             1.0             ricplt
95   r1-submgr              1        Tue Nov 26 00:47:13 2019  DEPLOYED    submgr-1.1.0            1.0             ricplt
96   r1-vespamgr            1        Tue Nov 26 00:47:14 2019  DEPLOYED    vespamgr-0.0.1          1.0             ricplt
97   r1-xapp-tiller         1        Tue Nov 26 00:45:44 2019  DEPLOYED    xapp-tiller-0.1.0       1.0             ricinfra
98
99   # kubectl get pods -n ricinfra
100   NAME                                              READY   STATUS     RESTARTS   AGE
101   deployment-ricinfra-chartmuseum-7d97f4b995-gkxsq  1/1     Running    0          133m
102   deployment-tiller-ricxapp-65f9cbc8d7-qcr5t        1/1     Running    0          133m
103   job-ricinfra-chartmuseum-save-certs-5ntnk         0/1     Completed  0          133m
104   r1-kong-kong-84695ff65d-9sjwg                     2/2     Running    2          133m
105   tiller-secret-generator-w6bnd                     0/1     Completed  0          133m
106
107   # kubectl get pods -n ricplt
108   NAME                                              READY   STATUS     RESTARTS   AGE
109   deployment-ricplt-a1mediator-5c4df477f9-6zxxx     1/1     Running    0          132m
110   deployment-ricplt-appmgr-65bc8b958c-tggg7         1/1     Running    0          132m
111   deployment-ricplt-dbaas-74bf584449-k484v          1/1     Running    0          132m
112   deployment-ricplt-e2mgr-74cd9865bc-hpn6b          1/1     Running    0          132m
113   deployment-ricplt-e2term-cc7b5d99-pkctr           1/1     Running    0          132m
114   deployment-ricplt-jaegeradapter-cc49c64dc-vj622   1/1     Running    0          131m
115   deployment-ricplt-rsm-599cd4d6c8-4jhft            1/1     Running    0          131m
116   deployment-ricplt-rtmgr-85d89868d6-58wvl          1/1     Running    1          132m
117   deployment-ricplt-submgr-7cbd697c7f-p9x4x         1/1     Running    0          132m
118   deployment-ricplt-vespamgr-7bb4c7585f-9z6qm       1/1     Running    0          132m
119
120
121 Checking Container Health
122 -------------------------
123
124 Check the health of the application manager platform component by querying it
125 via the ingress controller using the following command.
126
127 .. code:: bash
128
129   % curl -v http://localhost:32080/appmgr/ric/v1/health/ready
130
131 The output should look as follows.
132
133 .. code::
134
135   *   Trying 10.0.2.100...
136   * TCP_NODELAY set
137   * Connected to 10.0.2.100 (10.0.2.100) port 32080 (#0)
138   > GET /appmgr/ric/v1/health/ready HTTP/1.1
139   > Host: 10.0.2.100:32080
140   > User-Agent: curl/7.58.0
141   > Accept: */*
142   > 
143   < HTTP/1.1 200 OK
144   < Content-Type: application/json
145   < Content-Length: 0
146   < Connection: keep-alive
147   < Date: Wed, 22 Jan 2020 20:55:39 GMT
148   < X-Kong-Upstream-Latency: 0
149   < X-Kong-Proxy-Latency: 2
150   < Via: kong/1.3.1
151   < 
152   * Connection #0 to host 10.0.2.100 left intact
153
154
155 Undeploying the Infrastructure and Platform Groups
156 --------------------------------------------------
157
158 To undeploy all the containers, perform the following steps in a root shell
159 within the it-dep repository.
160
161 .. code:: bash
162
163   # cd bin
164   # ./undeploy-ric-platform
165   # ./undeploy-ric-infra
166
167 Results similar to below indicate a complete and successful cleanup.
168
169 .. code::
170
171   # ./undeploy-ric-platform 
172   Undeploying RIC platform components [appmgr rtmgr dbaas1 e2mgr e2term a1mediator submgr vespamgr rsm jaegeradapter]
173   release "r1-appmgr" deleted
174   release "r1-rtmgr" deleted
175   release "r1-dbaas1" deleted
176   release "r1-e2mgr" deleted
177   release "r1-e2term" deleted
178   release "r1-a1mediator" deleted
179   release "r1-submgr" deleted
180   release "r1-vespamgr" deleted
181   release "r1-rsm" deleted
182   release "r1-jaegeradapter" deleted
183   Undeploying RIC platform components [extsvcplt]
184   release "r1-extsvcplt" deleted
185   
186   # ./undeploy-ric-infra
187   Please reset your kubernetes cluster manually.
188   Undeploying RIC infra components [chartmuseum]
189   release "r1-chartmuseum" deleted
190   Undeploying RIC infra components [elfkp]
191   Undeploying RIC infra components [kong]
192   release "r1-kong" deleted
193   Undeploying RIC infra components [credential]
194   release "r1-ricaux-credential" deleted
195   release "r1-ricinfra-credential" deleted
196   release "r1-ricplt-credential" deleted
197   release "r1-ricxapp-credential" deleted
198   Undeploying RIC infra components [xapp-tiller]
199   release "r1-xapp-tiller" deleted
200
201
202 Restarting the VM
203 -----------------
204
205 After a reboot of the VM, and a suitable delay for initialization,
206 all the containers should be running again as shown above.