blob: 1715237cac225f498cc3acd8177064f6a99fb114 [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
4Helm Chart Based DCAE Deployment
5================================
6
Jack Lucas34c40222019-05-16 09:42:56 -04007This document describes the details of the Helm chart based deployment process for R4 ONAP and how DCAE is deployed through this process.
Lusheng Ji768421b2018-06-01 16:36:54 -04008
9
10ONAP Deployment Overview
11------------------------
12
Jack Lucas34c40222019-05-16 09:42:56 -040013ONAP R4 extends the Kubernetes deployment method introduced in R2 and continued in R3.
14Kubernetes is a container orchestration technology that organizes containers into composites of various patterns for easy deployment, management, and scaling.
15ONAP uses Kubernetes as the foundation for fulfilling its platform maturity promises.
Lusheng Ji768421b2018-06-01 16:36:54 -040016
Jack Lucas34c40222019-05-16 09:42:56 -040017ONAP manages Kubernetes specifications using Helm charts, under which all Kubernetes yaml-formatted resource specifications and additional files
18are organized into a hierarchy of charts, sub-charts, and resources. These yaml files are further augmented with Helm's templating, which makes dependencies
19and 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 -040020
Jack Lucas34c40222019-05-16 09:42:56 -040021At deployment time, with a single **helm deploy** command, Helm resolves all the templates and compiles the chart hierarchy into Kubernetes resource definitions,
22and invokes Kubernetes deployment operations for all the resources.
Lusheng Ji768421b2018-06-01 16:36:54 -040023
Jack Lucas34c40222019-05-16 09:42:56 -040024All ONAP Helm charts are organized under the **kubernetes** directory of the **OOM** project, where roughly each ONAP component occupies a subdirectory.
25DCAE charts are placed under the **dcaegen2** directory.
Lusheng Ji768421b2018-06-01 16:36:54 -040026
Donald Huntera5683c62018-11-06 22:54:51 +000027The PNDA data platform is an optional DCAE component that is placed under the **pnda**
28directory. Details for how to configure values to enable PNDA installation during Helm install
Jack Lucas34c40222019-05-16 09:42:56 -040029are described in `Installing PNDA During Helm Chart Based DCAE Deployment
Donald Hunter1e7e2ef2018-11-21 14:17:28 +000030<installation_pnda>`.
Lusheng Ji768421b2018-06-01 16:36:54 -040031
32DCAE 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.
41* ``templates``: subdirectory for Kubernetes resource definition templates.
42* ``charts``: subdirectory for 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.
53* ``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 -040054
55DCAE Deployment
56---------------
57
Jack Lucas34c40222019-05-16 09:42:56 -040058At deployment time, when the **helm deploy** command is executed,
59all DCAE resources defined within the subcharts above are deployed.
60These include:
Donald Huntera5683c62018-11-06 22:54:51 +000061
Jack Lucas34c40222019-05-16 09:42:56 -040062* the DCAE bootstrap service
63* the DCAE healthcheck service
64* the DCAE platform components:
Lusheng Ji768421b2018-06-01 16:36:54 -040065
Jack Lucas34c40222019-05-16 09:42:56 -040066 * Cloudify Manager
67 * Config binding service
68 * Deployment handler
69 * Policy handler
70 * Service change handler
71 * Inventory API service (launched as a subchart of service change handler)
72 * Inventory postgres database service (launched as a dependency of the inventory API service)
73 * DCAE postgres database service (launched as a dependency of the bootstrap service)
74 * DCAE Redis cluster
Lusheng Ji768421b2018-06-01 16:36:54 -040075
Jack Lucas34c40222019-05-16 09:42:56 -040076Some of the DCAE subcharts include an initContainer that checks to see if
77other services that they need in order to run have become ready. The installation
78of these subcharts will pause until the needed services are available.
Donald Huntera5683c62018-11-06 22:54:51 +000079
Jack Lucas34c40222019-05-16 09:42:56 -040080In addition, DCAE operations depends on a Consul server cluster.
81For ONAP OOM deployment, the Consul cluster is provided as a shared
82resource. Its charts are defined under the ``oom/kubernetes/consul``
83directory, not as part of the DCAE chart hierarchy.
Lusheng Ji768421b2018-06-01 16:36:54 -040084
Jack Lucas34c40222019-05-16 09:42:56 -040085The 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 -040086
Jack Lucas34c40222019-05-16 09:42:56 -040087 * dcae-cloudify-manager
88 * consul-server
89 * msb-discovery
90 * kube2msb
91 * dcae-config-binding-service
92 * dcae-db
Donald Huntera5683c62018-11-06 22:54:51 +000093
Jack Lucas34c40222019-05-16 09:42:56 -040094Once started, the DCAE bootstrap service will call Cloudify Manager to deploy
95a series of blueprints which specify the additional DCAE R4 components.
96These blueprints use the DCAE Kubernetes plugin (``k8splugin``) to deploy
97Docker images into the ONAP Kubernetes cluster. For each component, the plugin
98creates a Kubernetes deployment and other Kubernetes resources (services, volumes, logging sidecar, etc.)
99as needed.
Lusheng Ji768421b2018-06-01 16:36:54 -0400100
Jack Lucas34c40222019-05-16 09:42:56 -0400101The DCAE bootstrap service creates the following Kubernetes deployments:
102
103* deploy/dep-dcae-dashboard
104* deploy/dep-dcae-hv-ves-collector
105* deploy/dep-dcae-prh
106* deploy/dep-dcae-snmptrap-collector
107* deploy/dep-dcae-tca-analytics
108* deploy/dep-dcae-ves-collector
109* deploy/dep-holmes-engine-mgmt
110* deploy/dep-holmes-rule-mgmt
111
112After deploying all of the blueprints, the DCAE bootstrap service
113continues to run. The bootstrap container can be useful for
114troubleshooting or for launching additional components. The bootstrap
115container logs (accessed using the ``kubectl logs`` command) show the
116details of all of the component deployments.
Lusheng Ji768421b2018-06-01 16:36:54 -0400117
118DCAE Configuration
119------------------
120
121Deployment time configuration of DCAE components are defined in several places.
122
123 * Helm Chart templates:
124 * Helm/Kubernetes template files can contain static values for configuration parameters;
125 * Helm Chart resources:
126 * Helm/Kubernetes resources files can contain static values for configuration parameters;
127 * Helm values.yaml files:
128 * The values.yaml files supply the values that Helm templating engine uses to expand any templates defined in Helm templates;
129 * In a Helm chart hierarchy, values defined in values.yaml files in higher level supersedes values defined in values.yaml files in lower level;
130 * Helm command line supplied values supersedes values defined in any values.yaml files.
131
Jack Lucas34c40222019-05-16 09:42:56 -0400132In 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 +0000133
Jack Lucas34c40222019-05-16 09:42:56 -0400134 * The blueprint files can contain static values for configuration parameters;
135 * The blueprint files are defined under the ``blueprints`` directory of the ``dcaegen2/platform/blueprints`` repo, named with "k8s" prefix.
136 * 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):
137 * The blueprint files can define default values for the input parameters;
138 * 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;
139 * 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 -0400140
141
Jack Lucas34c40222019-05-16 09:42:56 -0400142Now we walk through an example, how to configure the Docker image for the DCAE dashboard, which is deployed by Cloudify Manager.
Lusheng Ji768421b2018-06-01 16:36:54 -0400143
Jack Lucas34c40222019-05-16 09:42:56 -0400144In the ``k8s-dashboard.yaml-template`` blueprint template, the Docker image to use is defined as an input parameter with a default value:
Lusheng Ji768421b2018-06-01 16:36:54 -0400145
Jack Lucas34c40222019-05-16 09:42:56 -0400146.. code-block::
Lusheng Ji768421b2018-06-01 16:36:54 -0400147
Jack Lucas34c40222019-05-16 09:42:56 -0400148 dashboard_docker_image:
149 description: 'Docker image for dashboard'
150 default: 'nexus3.onap.org:10001/onap/org.onap.ccsdk.dashboard.ccsdk-app-os:1.1.0-SNAPSHOT-latest'
Lusheng Ji768421b2018-06-01 16:36:54 -0400151
Jack Lucas34c40222019-05-16 09:42:56 -0400152Then in the input file, ``oom/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-dashboard-inputs.yaml``,
153it is defined again as:
154
155.. code-block::
156
157 dashboard_docker_image: {{ include "common.repository" . }}/{{ .Values.componentImages.dashboard }}
158
159Thus, when ``common.repository`` and ``componentImages.policy_handler`` are defined in the ``values.yaml`` files,
160their values will be plugged in here and the resulting ``policy_handler_image`` value
161will be passed to the Policy Handler blueprint as the Docker image tag to use instead of the default value in the blueprint.
162
163Indeed the ``componentImages.dashboard`` value is provided in the ``oom/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml`` file:
164
165.. code-block::
166
Lusheng Ji768421b2018-06-01 16:36:54 -0400167 componentImages:
Jack Lucas34c40222019-05-16 09:42:56 -0400168 dashboard: onap/org.onap.ccsdk.dashboard.ccsdk-app-os:1.1.0
Lusheng Ji768421b2018-06-01 16:36:54 -0400169
Jack Lucas34c40222019-05-16 09:42:56 -0400170The final result is that when DCAE bootstrap calls Cloudify Manager to deploy the DCAE dashboard, the 1.1.0 image will be deployed.
Lusheng Ji768421b2018-06-01 16:36:54 -0400171
172DCAE Service Endpoints
173----------------------
174
Jack Lucas34c40222019-05-16 09:42:56 -0400175Below is a table of default hostnames and ports for DCAE component service endpoints in Kubernetes deployment:
Donald Hunter1e7e2ef2018-11-21 14:17:28 +0000176 ================== ================================= ======================================================
Vijay VK86cd8932018-10-23 16:35:29 +0100177 Component Cluster Internal (host:port) Cluster external (svc_name:port)
Donald Hunter1e7e2ef2018-11-21 14:17:28 +0000178 ================== ================================= ======================================================
Vijay VK86cd8932018-10-23 16:35:29 +0100179 VES dcae-ves-collector:8080 xdcae-ves-collector.onap:30235
180 HV-VES dcae-hv-ves-collector:6061 xdcae-hv-ves-collector.onap:30222
181 TCA dcae-tca-analytics:11011 xdcae-tca-analytics.onap:32010
Vijay VKf6659fc2018-11-02 05:07:27 +0100182 PRH dcae-prh:8100 NA
Jack Lucas34c40222019-05-16 09:42:56 -0400183 SNMPTrap dcae-snmptrap-collector:6162/udp xdcae-snmptrap-collector:30470/UDP
Vijay VK86cd8932018-10-23 16:35:29 +0100184 Policy Handler policy-handler:25577 NA
185 Deployment Handler deployment-handler:8443 NA
186 Inventory inventory:8080 NA
Jack Lucas34c40222019-05-16 09:42:56 -0400187 Config binding config-binding-service:10000 config-binding-servicee:30415
Vijay VK86cd8932018-10-23 16:35:29 +0100188 DCAE Healthcheck dcae-healthcheck:80 NA
189 Cloudify Manager dcae-cloudify-manager:80 NA
Jack Lucas34c40222019-05-16 09:42:56 -0400190 DCAE Dashboard dcae-dashboard:8080/8443 xdcae-dashboard:30418/30419
Donald Hunter1e7e2ef2018-11-21 14:17:28 +0000191 ================== ================================= ======================================================
Lusheng Ji768421b2018-06-01 16:36:54 -0400192
Filip Krzywkacbd2ded2018-09-25 14:43:18 +0200193In addition, a number of ONAP service endpoints that are used by DCAE components are listed as follows
194for reference by DCAE developers and testers:
Donald Huntera5683c62018-11-06 22:54:51 +0000195
Filip Krzywkacbd2ded2018-09-25 14:43:18 +0200196 ==================== ============================ ================================
197 Component Cluster Internal (host:port) Cluster external (svc_name:port)
198 ==================== ============================ ================================
199 Consul Server consul-server:8500 consul-server:30270
200 Robot robot:88 robot:30209 TCP
201 Message router message-router:3904 message-router:30227
202 Message router message-router:3905 message-router:30226
203 Message router Kafka message-router-kafka:9092 NA
204 MSB Discovery msb-discovery:10081 msb-discovery:30281
205 Logging log-kibana:5601 log-kibana:30253
206 AAI aai:8080 aai:30232
207 AAI aai:8443 aai:30233
208 ==================== ============================ ================================
Lusheng Ji768421b2018-06-01 16:36:54 -0400209
Jack Lucas34c40222019-05-16 09:42:56 -0400210Uninstalling DCAE
211-----------------
212
213All of the DCAE components deployed using the OOM Helm charts will be
214deleted by the ``helm undeploy`` command. This command can be used to
215uninstall all of ONAP by undeploying the top-level Helm release that was
216created by the ``helm deploy`` command. The command can also be used to
217uninstall just DCAE, by having the command undeploy the `top_level_release_name`-``dcaegen2``
218Helm sub-release.
219
220Helm will undeploy only the components that were originally deployed using
221Helm charts. Components deployed by Cloudify Manager are not deleted by
222the Helm operations.
223
224When uninstalling all of ONAP, it is sufficient to delete the namespace
225used for the deployment (typically ``onap``) after running the undeploy
226operation. Deleting the namespace will get rid of any remaining resources
227in the namespace, including the components deployed by Cloudify Manager.
228
229When uninstalling DCAE alone, deleting the namespace would delete the
230rest of ONAP as well. To delete DCAE alone, and to make sure all of the
231DCAE components deployed by Cloudify Manager are uninstalled:
232
233* Find the Cloudify Manager pod identifier, using a command like:
234
235 ``kubectl -n onap get pods | grep dcae-cloudify-manager``
236* Execute the DCAE cleanup script on the Cloudify Manager pod, using a command like:
237
238 ``kubectl -n onap exec`` `cloudify-manager-pod-id` ``-- /scripts/dcae-cleanup.sh``
239* Finally, run ``helm undeploy`` against the DCAE Helm subrelease
240
241The DCAE cleanup script uses Cloudify Manager and the DCAE Kubernetes
242plugin to instruct Kubernetes to delete the components deployed by Cloudify
243Manager. This includes the components deployed when the DCAE bootstrap
244service ran and any components deployed after bootstrap.