b4db91bfae3efb7895b26cb7487e8eb0434b5040
[dcaegen2.git] / docs / sections / installation_oom.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 DCAE Deployment (using Helm)
5 ============================
6
7 This document describes the details of the Helm chart based deployment process for ONAP and how DCAE is deployed through this process.
8
9
10 Deployment Overview
11 -------------------
12
13 ONAP deployments are done on kubernetes through OOM/Helm charts. Kubernetes is a container orchestration technology that organizes containers into composites of various patterns for easy deployment, management, and scaling.
14 ONAP uses Kubernetes as the foundation for fulfilling its platform maturity promises.
15
16 ONAP manages Kubernetes specifications using Helm charts (in OOM project), under which all Kubernetes yaml-formatted resource specifications and additional files
17 are organized into a hierarchy of charts, sub-charts, and resources.  These yaml files are further augmented with Helm's templating, which makes dependencies
18 and cross-references of parameters and parameter derivatives among resources manageable for a large and complex Kubernetes system such as ONAP.
19
20 At deployment time, with a single **helm deploy** command, Helm resolves all the templates and compiles the chart hierarchy into Kubernetes resource definitions,
21 and invokes Kubernetes deployment operations for all the resources.
22
23 All ONAP Helm charts are organized under the **kubernetes** directory of the **OOM** project, where roughly each ONAP component occupies a subdirectory.
24
25
26 With DCAE Transformation to Helm completed in Jakarta/R10 release, all DCAE components deployment is supported only via helm.  Charts for individual MS are available under **dcaegen2-services** directory under OOM project (https://git.onap.org/oom/tree/kubernetes/dcaegen2-services/components). With ONAP deployment, four DCAE services (HV VES collector, VES collector, PNF Registration Handler, and TCA (Gen2) analytics service) are bootstrapped via Helm charts.
27
28 Other DCAE Services can be deployed on-demand via their independent helm-charts. For on-demand helm chart, refer to steps described in :ref:`Helm install/upgrade section <dcae-service-deployment>`.
29
30
31 .. note:: 
32   DCAE platform components deployments is optionally available through Helm charts under the **dcaegen2** directory however this mode is not supported with Jakarta release. These charts will be removed in subsequent release.
33   
34
35
36 DCAE Chart Organization
37 -----------------------
38
39 Following Helm conventions, the DCAE Helm chart directory (``oom/kubernetes/dcaegen2-services`` & ``oom/kubernetes/dcaegen2``) consists of the following files and subdirectories:
40
41 * ``Chart.yaml``: metadata.
42 * ``requirements.yaml``: dependency charts.
43 * ``values.yaml``: values for Helm templating engine to expand templates.
44 * ``resources``: subdirectory for additional resource definitions such as configuration, scripts, etc.
45 * ``Makefile``: make file to build DCAE charts
46 * ``components``: subdirectory for DCAE sub-charts.
47
48
49 The dcaegen2-services chart has the following sub-charts:
50
51 * ``dcae-datafile-collector``: deploys the DCAE DataFile Collector service.
52 * ``dcae-hv-ves-collector``: deploys the DCAE High-Volume VES collector service.
53 * ``dcae-ms-healthcheck``: deploys a health check component that tests the health of the 4 DCAE services deployed via Helm.
54 * ``dcae-pm-mapper``: deploys the DCAE PM-Mapper service.
55 * ``dcae-prh``: deploys the DCAE PNF Registration Handler service.
56 * ``dcae-tcagen2``: deploys the DCAE TCA analytics service.
57 * ``dcae-ves-collector``: deploys the DCAE VES collector service.
58 * ``dcae-bbs-eventprocessor-ms``: deploys the DCAE BBS Eventprocessor service.
59 * ``dcae-datafile-collector``: deploys the DCAE Datafile collector service.
60 * ``dcae-datalake-admin-ui``: deploys the Datalake Admin UI service.
61 * ``dcae-datalake-des``: deploys the Datalake Data Extraction service.
62 * ``dcae-datalake-feeder``: deploys the Datalake Feeder service.
63 * ``dcae-heartbeat``: deploys the DCAE Heartbeat microservice.
64 * ``dcae-kpi-ms``: deploys the DCAE KPI computation microservice.
65 * ``dcae-ms-healthcheck``: deploys the DCAE healthcheck service that provides API to check health of bootstrapped DCAE service deployed via helm
66 * ``dcae-pm-mapper``: deploys the DCAE PM-Mapper service.
67 * ``dcae-pmsh``: deploys the DCAE PM Subscription Handler service.
68 * ``dcae-restconf-collector``: deploys the DCAE RESTConf collector service.
69 * ``dcae-slice-analysis-ms``: deploys the DCAE Slice Analysis service.
70 * ``dcae-snmptrap-collector``: deploys the DCAE SNMPTRAP collector service.
71 * ``dcae-son-handler``: deploys the DCAE SON-Handler microservice.
72 * ``dcae-ves-mapper``: deploys the DCAE VES Mapper microservice.
73 * ``dcae-ves-openapi-manager``: deploys the DCAE service validator of VES_EVENT type artifacts from distributed services.
74
75
76 The dcaegen2-services sub-charts depend on a set of common templates, found under the ``common`` subdirectory under ``dcaegen2-services``.
77
78 Information about using the common templates to deploy a microservice can be
79 found in :doc:`Using Helm to deploy DCAE Microservices <./dcaeservice_helm_template>`.
80
81 The dcaegen2 chart has the following sub-charts:
82
83 * ``dcae-bootstrap``: deploys the DCAE bootstrap service that performs some DCAE initialization and deploys additional DCAE components.
84 * ``dcae-cloudify-manager``: deploys the DCAE Cloudify Manager instance.
85 * ``dcae-config-binding-service``: deploys the DCAE config binding service.
86 * ``dcae-deployment-handler``: deploys the DCAE deployment handler service.
87 * ``dcae-healthcheck``: deploys the DCAE healthcheck service that provides an API to check the health of all DCAE components.
88 * ``dcae-policy-handler``: deploys the DCAE policy handler service.
89 * ``dcae-redis``: deploys the DCAE Redis cluster.
90 * ``dcae-dashboard``: deploys the DCAE Dashboard for managing DCAE microservices deployments
91 * ``dcae-servicechange-handler``: deploys the DCAE service change handler service.
92 * ``dcae-inventory-api``: deploys the DCAE inventory API service.
93
94 These components are by default disabled under ONAP for Jakarta release and charts will be removed next release
95
96 DCAE Deployment
97 ---------------
98
99 At deployment time for ONAP, when the **helm deploy** command is executed,
100 only the DCAE resources defined within the subcharts - "dcaegen2-services" above are deployed
101 (based on override file configuration defined in `values.yaml <https://git.onap.org/oom/tree/kubernetes/dcaegen2-services/values.yaml>`_
102
103 These include:
104
105 * DCAE Service components:
106   * VES Collector
107   * HV-VES Collector
108   * PNF-Registration Handler Service
109   * Threshold Crossing Analysis (TCA-gen2)
110 * DCAE-Services healthcheck 
111 * VES OpenAPI Manager
112
113 Some of the DCAE subcharts include an initContainer that checks to see if
114 other services that they need in order to run have become ready.  The installation
115 of these subcharts will pause until the needed services are available.
116
117 Since Istanbul release, DCAE bootstrapped Microservice deployment are managed completely under Helm.
118
119 Additionaly tls-init-container invoked during component deployment relies on AAF to generate the required certificate hence AAF
120 must be enabled under OOM deployment configuration. 
121
122 As majority of DCAE services rely on DMAAP (MR and DR) interfaces, ONAP/DMAAP must also be enabled under OOM deployment configuration. 
123
124 DCAE Configuration
125 ------------------
126
127 Deployment time configuration of DCAE components are defined in several places.
128
129   * Helm Chart templates:
130      * Helm/Kubernetes template files can contain static values for configuration parameters;
131   * Helm Chart resources:
132      * Helm/Kubernetes resources files can contain static values for configuration parameters;
133   * Helm values.yaml files:
134      * The values.yaml files supply the values that Helm templating engine uses to expand any templates defined in Helm templates;
135      * In a Helm chart hierarchy, values defined in values.yaml files in higher level supersedes values defined in values.yaml files in lower level;
136      * Helm command line supplied values supersedes values defined in any values.yaml files.
137
138
139 .. _dcae-service-deployment:
140 On-demand deployment/upgrade through Helm
141 -----------------------------------------
142
143 Under DCAE Transformation to Helm, all DCAE components has been delivered as helm charts under
144 OOM repository (https://git.onap.org/oom/tree/kubernetes/dcaegen2-services). 
145
146
147 All DCAE component charts follows standard Helm structure. Each Microservice charts has predefined configuration defined under
148 ``applicationConfig`` which can be modified or overridden at deployment time.
149
150 Using helm, any of DCAE microservice can be deployed/upgraded/uninstalled on-demand.
151
152 ``Pre-Install``
153
154 .. note::
155   This step is only required when helm install should be done on different releasename/prefix from rest of ONAP deployment
156
157 With Istanbul release, OOM team included support for ServiceAccount in ONAP deployment to limit the pod access to API server.
158
159 Following packages has been added under oom/common to support pre-provisioning of cluster roles and ServiceAccount management
160
161   * `ServiceAccount <https://git.onap.org/oom/tree/kubernetes/common/serviceAccount/values.yaml>`_ 
162   * `RoleWrapper <https://git.onap.org/oom/tree/kubernetes/common/roles-wrapper>`_
163  
164 When deployed, these chart will create the ServiceAccount and Role (based on override) and required Rolebinding (to associate the Serviceaccount to a role).
165
166 ONAP deployment by default includes the required provisioning of roles under release name (such as "dev") under which ONAP is deployed. For subsequent
167 helm installation under same release name prefix (i.e dev-) no further action is required.
168
169 When Helm install is required under different releasename prefix, then execute following command prior to running helm install.
170
171    .. code-block:: bash
172
173         helm install <DEPLOYMENT_PREFIX>-role-wrapper local/roles-wrapper -n <namespace>
174
175
176 Followed by install of required service/chart
177
178     .. code-block:: bash
179
180         helm -n <namespace> install <DEPLOYMENT_PREFIX>-dcaegen2-services oom/kubernetes/dcaegen2-services
181
182
183 ``Installation``
184
185 Review and update local copy of dcaegen2-service ``values.yaml`` oom/kubernetes/dcaegen2-services/values.yaml
186 to ensure component is enabled for deployment (or provide as command line override)
187
188     .. code-block:: bash
189
190         helm -n <namespace> install <DEPLOYMENT_PREFIX>-dcaegen2-services oom/kubernetes/dcaegen2-services
191
192
193 Service component can also be installed individually from oom/kubernetes/dcaegen2-services/components/<dcae-ms-chart>
194
195     .. code-block:: bash
196
197         helm -n onap install dev-dcaegen2-services-ves-mapper oom/kubernetes/dcaegen2-services/components/dcae-ves-mapper -f values.yaml
198
199 Using -f flag override file can be specified which will take precedence over default configuration. 
200 When commandline override is not provided, default (values.yaml) provided in chart-directory will be used.
201
202 ``Upgrade``
203
204 Helm support upgrade of charts already deployed; using ``upgrade``  component deployment can be modified
205
206     .. code-block:: bash
207
208         helm -n <namespace> upgrade <DEPLOYMENT_PREFIX>-dcaegen2-services --reuse-values --values <updated values.yaml path> <dcaegen2-services helm charts path>
209
210
211 For minor configuration updates, helm also supports new values to be provided inline to the upgrade command. Example below -
212
213     .. code-block:: bash
214
215         helm -n onap upgrade dev-dcaegen2-services oom/kubernetes/dcaegen2-services --reuse-values --set dcae-ves-collector.applicationConfig.auth.method="noAuth"
216
217 ``Uninstall``
218
219 Components can be uninstalled using delete command.
220
221     .. code-block:: bash
222
223         helm -n <namespace> delete <DEPLOYMENT_PREFIX>-dcaegen2-services 
224
225 DCAE Service Endpoints
226 ----------------------
227
228 Below is a table of default hostnames and ports for DCAE component service endpoints in Kubernetes deployment:
229     ===================  ==================================   =======================================================
230     Component            Cluster Internal (host:port)         Cluster external (svc_name:port)
231     ===================  ==================================   =======================================================
232     VES                  dcae-ves-collector:8443              dcae-ves-collector.onap:30417
233     HV-VES               dcae-hv-ves-collector:6061           dcae-hv-ves-collector.onap:30222
234     TCA-Gen2             dcae-tcagen2:9091                    NA
235     PRH                  dcae-prh:8100                        NA
236     DCAE MS Healthcheck  dcae-ms-healthcheck:8080             NA
237     ===================  ==================================   =======================================================
238
239 In addition, a number of ONAP service endpoints that are used by DCAE components are listed as follows
240 for reference by DCAE developers and testers:
241
242     ====================   ============================      ================================
243     Component              Cluster Internal (host:port)      Cluster external (svc_name:port)
244     ====================   ============================      ================================
245     Robot                  robot:88                          robot:30209 TCP
246     Message router         message-router:3904               NA
247     Message router         message-router:3905               message-router-external:30226
248     Message router Kafka   message-router-kafka:9092         NA
249     ====================   ============================      ================================
250
251 Uninstalling DCAE
252 -----------------
253
254 All of the DCAE components deployed using the OOM Helm charts will be
255 deleted by the ``helm undeploy`` command.  This command can be used to
256 uninstall all of ONAP by undeploying the top-level Helm release that was
257 created by the ``helm deploy`` command.  The command can also be used to
258 uninstall just DCAE, by having the command undeploy the `top_level_release_name`-``dcaegen2-services``
259 Helm sub-release.
260
261 Helm will undeploy only the components that were originally deployed using
262 Helm charts.  Components deployed by Cloudify Manager are not deleted by
263 the Helm operations.
264
265 When uninstalling all of ONAP, it is sufficient to delete the namespace
266 used for the deployment (typically ``onap``) after running the undeploy
267 operation.  Deleting the namespace will get rid of any remaining resources
268 in the namespace, including the components deployed by Cloudify Manager.
269
270
271 To undeploy the DCAE services deployed via Helm (the hv-ves-collector, ves-collector, tcagen2,
272 and prh), use the ``helm undeploy`` command against the `top_level_release_name`-``dcaegen2-services``
273 Helm sub-release.