blob: 443b970a43c13388332503b61cc05f2c6bf9d9f8 [file] [log] [blame]
Lusheng Ji768421b2018-06-01 16:36:54 -04001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3
Vijay VKf9e43442019-05-22 22:10:29 +01004DCAE Deployment (using Helm and Cloudify)
5=========================================
Lusheng Ji768421b2018-06-01 16:36:54 -04006
VENKATESH KUMAR3e2bb4c2020-05-13 16:21:54 -04007This document describes the details of the Helm chart based deployment process for ONAP and how DCAE is deployed through this process.
Lusheng Ji768421b2018-06-01 16:36:54 -04008
9
Vijay VKf9e43442019-05-22 22:10:29 +010010Deployment Overview
11-------------------
Lusheng Ji768421b2018-06-01 16:36:54 -040012
VENKATESH KUMAR3e2bb4c2020-05-13 16:21:54 -040013ONAP 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.
Jack Lucas34c40222019-05-16 09:42:56 -040014ONAP uses Kubernetes as the foundation for fulfilling its platform maturity promises.
Lusheng Ji768421b2018-06-01 16:36:54 -040015
VENKATESH KUMAR3e2bb4c2020-05-13 16:21:54 -040016ONAP manages Kubernetes specifications using Helm charts (in OOM project), under which all Kubernetes yaml-formatted resource specifications and additional files
Jack Lucas34c40222019-05-16 09:42:56 -040017are organized into a hierarchy of charts, sub-charts, and resources. These yaml files are further augmented with Helm's templating, which makes dependencies
18and cross-references of parameters and parameter derivatives among resources manageable for a large and complex Kubernetes system such as ONAP.
Lusheng Ji768421b2018-06-01 16:36:54 -040019
Jack Lucas34c40222019-05-16 09:42:56 -040020At deployment time, with a single **helm deploy** command, Helm resolves all the templates and compiles the chart hierarchy into Kubernetes resource definitions,
21and invokes Kubernetes deployment operations for all the resources.
Lusheng Ji768421b2018-06-01 16:36:54 -040022
Jack Lucas34c40222019-05-16 09:42:56 -040023All ONAP Helm charts are organized under the **kubernetes** directory of the **OOM** project, where roughly each ONAP component occupies a subdirectory.
24DCAE charts are placed under the **dcaegen2** directory.
Lusheng Ji768421b2018-06-01 16:36:54 -040025
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -040026All DCAE platform components have corresponding Helm chart which will be used to trigger the deployment.
Vijay VKf9e43442019-05-22 22:10:29 +010027All DCAE Services are deployed through Cloudify Blueprint. The default ONAP DCAE deployment includes small subset of DCAE services deployed through Bootstrap pod to meet
VENKATESH KUMAR7cac7242020-06-04 11:17:10 -040028ONAP Integration usecases. Optionally operators can deploy on-demand other MS required for their usecases as described in :doc:`On-demand MS Installation
29<./installation_MS_ondemand>`.
30
Vijay VKf9e43442019-05-22 22:10:29 +010031
Lusheng Ji768421b2018-06-01 16:36:54 -040032DCAE Chart Organization
33-----------------------
34
Jack Lucas34c40222019-05-16 09:42:56 -040035Following Helm conventions, the DCAE Helm chart directory (``oom/kubernetes/dcaegen2``) consists of the following files and subdirectories:
Lusheng Ji768421b2018-06-01 16:36:54 -040036
Jack Lucas34c40222019-05-16 09:42:56 -040037* ``Chart.yaml``: metadata.
38* ``requirements.yaml``: dependency charts.
39* ``values.yaml``: values for Helm templating engine to expand templates.
40* ``resources``: subdirectory for additional resource definitions such as configuration, scripts, etc.
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -040041* ``Makefile``: make file to build DCAE charts
42* ``components``: subdirectory for DCAE sub-charts.
Lusheng Ji768421b2018-06-01 16:36:54 -040043
44The dcaegen2 chart has the following sub-charts:
Guobiao Moc3dd8292018-06-26 11:12:36 -070045
Jack Lucas34c40222019-05-16 09:42:56 -040046* ``dcae-bootstrap``: deploys the DCAE bootstrap service that performs some DCAE initialization and deploys additional DCAE components.
47* ``dcae-cloudify-manager``: deploys the DCAE Cloudify Manager instance.
48* ``dcae-config-binding-service``: deploys the DCAE config binding service.
49* ``dcae-deployment-handler``: deploys the DCAE deployment handler service.
50* ``dcae-healthcheck``: deploys the DCAE healthcheck service that provides an API to check the health of all DCAE components.
51* ``dcae-policy-handler``: deploys the DCAE policy handler service.
52* ``dcae-redis``: deploys the DCAE Redis cluster.
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -040053* ``dcae-dashboard``: deploys the DCAE Dashboard for managing DCAE microservices deployments
Jack Lucas34c40222019-05-16 09:42:56 -040054* ``dcae-servicechange-handler``: deploys the DCAE service change handler service. A subchart (``dcae-inventory-api``) deploys the DCAE inventory API service.
Lusheng Ji768421b2018-06-01 16:36:54 -040055
56DCAE Deployment
57---------------
58
Jack Lucas34c40222019-05-16 09:42:56 -040059At deployment time, when the **helm deploy** command is executed,
60all DCAE resources defined within the subcharts above are deployed.
61These include:
Donald Huntera5683c62018-11-06 22:54:51 +000062
Jack Lucas34c40222019-05-16 09:42:56 -040063* the DCAE bootstrap service
64* the DCAE healthcheck service
65* the DCAE platform components:
Lusheng Ji768421b2018-06-01 16:36:54 -040066
Jack Lucas34c40222019-05-16 09:42:56 -040067 * Cloudify Manager
68 * Config binding service
69 * Deployment handler
70 * Policy handler
71 * Service change handler
72 * Inventory API service (launched as a subchart of service change handler)
73 * Inventory postgres database service (launched as a dependency of the inventory API service)
74 * DCAE postgres database service (launched as a dependency of the bootstrap service)
75 * DCAE Redis cluster
Lusheng Ji768421b2018-06-01 16:36:54 -040076
Jack Lucas34c40222019-05-16 09:42:56 -040077Some of the DCAE subcharts include an initContainer that checks to see if
78other services that they need in order to run have become ready. The installation
79of these subcharts will pause until the needed services are available.
Donald Huntera5683c62018-11-06 22:54:51 +000080
Jack Lucas34c40222019-05-16 09:42:56 -040081In addition, DCAE operations depends on a Consul server cluster.
82For ONAP OOM deployment, the Consul cluster is provided as a shared
83resource. Its charts are defined under the ``oom/kubernetes/consul``
84directory, not as part of the DCAE chart hierarchy.
Lusheng Ji768421b2018-06-01 16:36:54 -040085
Jack Lucas34c40222019-05-16 09:42:56 -040086The dcae-bootstrap service has a number of prerequisites because the subsequently deployed DCAE components depends on a number of resources having entered their normal operation state. DCAE bootstrap job will not start before these resources are ready. They are:
Lusheng Ji768421b2018-06-01 16:36:54 -040087
VENKATESH KUMAR3e2bb4c2020-05-13 16:21:54 -040088
Jack Lucas34c40222019-05-16 09:42:56 -040089 * dcae-cloudify-manager
90 * consul-server
91 * msb-discovery
92 * kube2msb
93 * dcae-config-binding-service
94 * dcae-db
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -040095 * dcae-mongodb
VENKATESH KUMAR3e2bb4c2020-05-13 16:21:54 -040096 * dcae-inventory-api
97
98Additionaly tls-init-container invoked during component deployment relies on AAF to generate the required certificate hence AAF
99must be enabled under OOM deployment configuration.
Donald Huntera5683c62018-11-06 22:54:51 +0000100
Jack Lucas34c40222019-05-16 09:42:56 -0400101Once started, the DCAE bootstrap service will call Cloudify Manager to deploy
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400102a series of blueprints which specify the additional DCAE microservice components.
Jack Lucas34c40222019-05-16 09:42:56 -0400103These blueprints use the DCAE Kubernetes plugin (``k8splugin``) to deploy
104Docker images into the ONAP Kubernetes cluster. For each component, the plugin
105creates a Kubernetes deployment and other Kubernetes resources (services, volumes, logging sidecar, etc.)
106as needed.
Lusheng Ji768421b2018-06-01 16:36:54 -0400107
Jack Lucas34c40222019-05-16 09:42:56 -0400108The DCAE bootstrap service creates the following Kubernetes deployments:
109
Jack Lucas34c40222019-05-16 09:42:56 -0400110* deploy/dep-dcae-hv-ves-collector
111* deploy/dep-dcae-prh
Jack Lucas34c40222019-05-16 09:42:56 -0400112* deploy/dep-dcae-tca-analytics
VENKATESH KUMAR3e2bb4c2020-05-13 16:21:54 -0400113* deploy/dep-dcae-tcagen2
Jack Lucas34c40222019-05-16 09:42:56 -0400114* deploy/dep-dcae-ves-collector
115* deploy/dep-holmes-engine-mgmt
116* deploy/dep-holmes-rule-mgmt
117
118After deploying all of the blueprints, the DCAE bootstrap service
119continues to run. The bootstrap container can be useful for
120troubleshooting or for launching additional components. The bootstrap
121container logs (accessed using the ``kubectl logs`` command) show the
122details of all of the component deployments.
Lusheng Ji768421b2018-06-01 16:36:54 -0400123
124DCAE Configuration
125------------------
126
127Deployment 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
Jack Lucas34c40222019-05-16 09:42:56 -0400138In addition, for DCAE components deployed through Cloudify Manager blueprints, their configuration parameters are defined in the following places:
Donald Huntera5683c62018-11-06 22:54:51 +0000139
Jack Lucas34c40222019-05-16 09:42:56 -0400140 * The blueprint files can contain static values for configuration parameters;
141 * The blueprint files are defined under the ``blueprints`` directory of the ``dcaegen2/platform/blueprints`` repo, named with "k8s" prefix.
142 * The blueprint files can specify input parameters and the values of these parameters will be used for configuring parameters in Blueprints. The values for these input parameters can be supplied in several ways as listed below in the order of precedence (low to high):
143 * The blueprint files can define default values for the input parameters;
144 * The blueprint input files can contain static values for input parameters of blueprints. These input files are provided as config resources under the dcae-bootstrap chart;
145 * The blueprint input files may contain Helm templates, which are resolved into actual deployment time values following the rules for Helm values.
Lusheng Ji768421b2018-06-01 16:36:54 -0400146
147
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400148Now we walk through an example, how to configure the Docker image for the DCAE VESCollector, which is deployed by Cloudify Manager.
Lusheng Ji768421b2018-06-01 16:36:54 -0400149
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400150In the `k8s-ves.yaml <https://git.onap.org/dcaegen2/platform/blueprints/tree/blueprints/k8s-ves.yaml>`_ blueprint, the Docker image to use is defined as an input parameter with a default value:
Lusheng Ji768421b2018-06-01 16:36:54 -0400151
Vijay VKf9e43442019-05-22 22:10:29 +0100152.. code-block:: yaml
Lusheng Ji768421b2018-06-01 16:36:54 -0400153
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400154 tag_version:
155 type: string
156 default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.5.4"
157
158The corresponding input file, ``https://git.onap.org/oom/tree/kubernetes/dcaegen2/components/dcae-bootstrap/resources/inputs/k8s-ves-inputs-tls.yaml``,
Jack Lucas34c40222019-05-16 09:42:56 -0400159it is defined again as:
160
Vijay VKf9e43442019-05-22 22:10:29 +0100161.. code-block:: yaml
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400162 {{ if .Values.componentImages.ves }}
163 tag_version: {{ include "common.repository" . }}/{{ .Values.componentImages.ves }}
164 {{ end }}
165
Jack Lucas34c40222019-05-16 09:42:56 -0400166
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400167Thus, when ``common.repository`` and ``componentImages.ves`` are defined in the ``values.yaml`` files,
168their values will be plugged in here and the resulting ``tag_version`` value
169will be passed to the blueprint as the Docker image tag to use instead of the default value in the blueprint.
Jack Lucas34c40222019-05-16 09:42:56 -0400170
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400171The ``componentImages.ves`` value is provided in the ``oom/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml`` file:
Jack Lucas34c40222019-05-16 09:42:56 -0400172
Vijay VKf9e43442019-05-22 22:10:29 +0100173.. code-block:: yaml
Jack Lucas34c40222019-05-16 09:42:56 -0400174
Lusheng Ji768421b2018-06-01 16:36:54 -0400175 componentImages:
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400176 ves: onap/org.onap.dcaegen2.collectors.ves.vescollector:1.5.4
Lusheng Ji768421b2018-06-01 16:36:54 -0400177
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400178
179The final result is that when DCAE bootstrap calls Cloudify Manager to deploy the DCAE VES collector, the 1.5.4 image will be deployed.
Lusheng Ji768421b2018-06-01 16:36:54 -0400180
181DCAE Service Endpoints
182----------------------
183
Jack Lucas34c40222019-05-16 09:42:56 -0400184Below is a table of default hostnames and ports for DCAE component service endpoints in Kubernetes deployment:
Donald Hunter1e7e2ef2018-11-21 14:17:28 +0000185 ================== ================================= ======================================================
Vijay VK86cd8932018-10-23 16:35:29 +0100186 Component Cluster Internal (host:port) Cluster external (svc_name:port)
Donald Hunter1e7e2ef2018-11-21 14:17:28 +0000187 ================== ================================= ======================================================
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400188 VES dcae-ves-collector:8443 xdcae-ves-collector.onap:30417
Vijay VK86cd8932018-10-23 16:35:29 +0100189 HV-VES dcae-hv-ves-collector:6061 xdcae-hv-ves-collector.onap:30222
190 TCA dcae-tca-analytics:11011 xdcae-tca-analytics.onap:32010
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400191 TCA-Gen2 dcae-tcagen2:9091 NA
Vijay VKf6659fc2018-11-02 05:07:27 +0100192 PRH dcae-prh:8100 NA
Vijay VK86cd8932018-10-23 16:35:29 +0100193 Policy Handler policy-handler:25577 NA
194 Deployment Handler deployment-handler:8443 NA
195 Inventory inventory:8080 NA
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400196 Config binding config-binding-service:10000/10001 config-binding-service:30415
Vijay VK86cd8932018-10-23 16:35:29 +0100197 DCAE Healthcheck dcae-healthcheck:80 NA
198 Cloudify Manager dcae-cloudify-manager:80 NA
VENKATESH KUMAR7cfaea22020-04-22 17:31:32 -0400199 DCAE Dashboard dcae-dashboard:8443 xdcae-dashboard:30419
Donald Hunter1e7e2ef2018-11-21 14:17:28 +0000200 ================== ================================= ======================================================
Lusheng Ji768421b2018-06-01 16:36:54 -0400201
Filip Krzywkacbd2ded2018-09-25 14:43:18 +0200202In addition, a number of ONAP service endpoints that are used by DCAE components are listed as follows
203for reference by DCAE developers and testers:
Donald Huntera5683c62018-11-06 22:54:51 +0000204
Filip Krzywkacbd2ded2018-09-25 14:43:18 +0200205 ==================== ============================ ================================
206 Component Cluster Internal (host:port) Cluster external (svc_name:port)
207 ==================== ============================ ================================
208 Consul Server consul-server:8500 consul-server:30270
209 Robot robot:88 robot:30209 TCP
210 Message router message-router:3904 message-router:30227
211 Message router message-router:3905 message-router:30226
212 Message router Kafka message-router-kafka:9092 NA
213 MSB Discovery msb-discovery:10081 msb-discovery:30281
214 Logging log-kibana:5601 log-kibana:30253
215 AAI aai:8080 aai:30232
216 AAI aai:8443 aai:30233
217 ==================== ============================ ================================
Lusheng Ji768421b2018-06-01 16:36:54 -0400218
Jack Lucas34c40222019-05-16 09:42:56 -0400219Uninstalling DCAE
220-----------------
221
222All of the DCAE components deployed using the OOM Helm charts will be
223deleted by the ``helm undeploy`` command. This command can be used to
224uninstall all of ONAP by undeploying the top-level Helm release that was
225created by the ``helm deploy`` command. The command can also be used to
226uninstall just DCAE, by having the command undeploy the `top_level_release_name`-``dcaegen2``
227Helm sub-release.
228
229Helm will undeploy only the components that were originally deployed using
230Helm charts. Components deployed by Cloudify Manager are not deleted by
231the Helm operations.
232
233When uninstalling all of ONAP, it is sufficient to delete the namespace
234used for the deployment (typically ``onap``) after running the undeploy
235operation. Deleting the namespace will get rid of any remaining resources
236in the namespace, including the components deployed by Cloudify Manager.
237
238When uninstalling DCAE alone, deleting the namespace would delete the
239rest of ONAP as well. To delete DCAE alone, and to make sure all of the
240DCAE components deployed by Cloudify Manager are uninstalled:
241
242* Find the Cloudify Manager pod identifier, using a command like:
243
244 ``kubectl -n onap get pods | grep dcae-cloudify-manager``
245* Execute the DCAE cleanup script on the Cloudify Manager pod, using a command like:
246
247 ``kubectl -n onap exec`` `cloudify-manager-pod-id` ``-- /scripts/dcae-cleanup.sh``
248* Finally, run ``helm undeploy`` against the DCAE Helm subrelease
249
250The DCAE cleanup script uses Cloudify Manager and the DCAE Kubernetes
251plugin to instruct Kubernetes to delete the components deployed by Cloudify
252Manager. This includes the components deployed when the DCAE bootstrap
253service ran and any components deployed after bootstrap.