Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 1 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 2 | .. http://creativecommons.org/licenses/by/4.0 |
| 3 | |
| 4 | Helm Chart Based DCAE Deployment |
| 5 | ================================ |
| 6 | |
Vijay VK | 2648c6d | 2018-09-19 04:30:37 +0100 | [diff] [blame] | 7 | This document describes the details of the Helm Chart based deployment process for R3 ONAP and how DCAE is deployed through this process. |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 8 | |
| 9 | |
| 10 | ONAP Deployment Overview |
| 11 | ------------------------ |
| 12 | |
Donald Hunter | e3cc247 | 2018-11-21 14:33:38 +0000 | [diff] [blame] | 13 | ONAP R3 is an extension of R2 Kubernetes deployment. Kubernetes is a container orchestration technology that organizes containers into composites of various patterns for easy deployment, management, and scaling. R2 ONAP utilized Kubernetes as the foundation for fulfilling its platform maturity promises and R3 contiunues to do so. |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 14 | |
Donald Hunter | e3cc247 | 2018-11-21 14:33:38 +0000 | [diff] [blame] | 15 | ONAP manages Kubernetes specifications using Helm Charts, under which all Kubernetes yaml-formatted resource specifications and additional files are organized into a hierarchy of charts, sub-charts, and resources. These yaml files are further augmented with Helm's templating, which makes dependencies and cross-references of parameters and parameter derivatives among resources manageable for a large and complex Kubernetes system such as ONAP. |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 16 | |
| 17 | At deployment time, with a single **helm install** command, Helm resolves all the templates and compiles the chart hierarchy into Kubernetes resource definitions, and invokes Kubernetes deployment operation for all the resources. |
| 18 | |
| 19 | All ONAP Helm Charts are organized under the **kubernetes** directory of the **OOM** project, where roughly each ONAP component occupied a subdirectory. DCAE charts are placed under the **dcaegen2** directory. DCAE Kubernetes deployment is based on the same set of Docker containers that the Heat based deployment uses, with the exception of bootstrap container and health check container are only used in Kubernetes deployment. |
| 20 | |
Donald Hunter | a5683c6 | 2018-11-06 22:54:51 +0000 | [diff] [blame] | 21 | The PNDA data platform is an optional DCAE component that is placed under the **pnda** |
| 22 | directory. Details for how to configure values to enable PNDA installation during Helm install |
Donald Hunter | 1e7e2ef | 2018-11-21 14:17:28 +0000 | [diff] [blame] | 23 | are described in :doc:`Installing PNDA During Helm Chart Based DCAE Deployment |
| 24 | <installation_pnda>`. |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 25 | |
| 26 | DCAE Chart Organization |
| 27 | ----------------------- |
| 28 | |
| 29 | Following Helm conventions, each Helm chart directory usually consists of the following files and subdirectories: |
| 30 | |
| 31 | * Chart.yaml: meta data; |
| 32 | * requirements.yaml: dependency charts; |
| 33 | * values.yaml: values for Helm templating engine to expand templates; |
| 34 | * resources: subdirectory for additional resource definitions such as configuration, scripts, etc; |
| 35 | * templates: subdirectory for Kubernetes resource definition templates; |
| 36 | * charts: subdirectory for sub-charts. |
| 37 | |
| 38 | The dcaegen2 chart has the following sub-charts: |
Guobiao Mo | c3dd829 | 2018-06-26 11:12:36 -0700 | [diff] [blame] | 39 | |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 40 | * dcae-bootstrap: a Kubernetes job that deploys additional DCAE components; |
| 41 | * dcae-cloudify-manager: a Kubernetes deployment of a Cloudify Manager; |
| 42 | * dcae-healthcheck: a Kubernetes deployment that provides a DCAE health check API; |
| 43 | * dcae-redis: a Kubernetes deployment of a Redis cluster. |
| 44 | |
| 45 | |
| 46 | DCAE Deployment |
| 47 | --------------- |
| 48 | |
| 49 | At deployment time, when the **helm install** command is executed, all DCAE resources defined within charts under the OOM Chart hierarchy are deployed. They are the 1st order components, namely the Cloudify Manager deployment, the Health Check deployment, the Redis cluster deployment, and the Bootstrap job. In addition, a Postgres database deployment is also launched, which is specified as a dependency of the DCAE Bootstrap job. These resources will show up as the following, where the name before / indicates resource type and the term "dev" is a tag that **helm install** command uses as "release name": |
Donald Hunter | a5683c6 | 2018-11-06 22:54:51 +0000 | [diff] [blame] | 50 | |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 51 | * deploy/dev-dcae-cloudify-manager; |
| 52 | * deploy/dev-dcae-healthcheck; |
| 53 | * statefulsets/dev-dcae-redis; |
| 54 | * statefulsets/dev-dcae-db; |
| 55 | * job/dev-dcae-bootstrap. |
| 56 | |
Donald Hunter | a5683c6 | 2018-11-06 22:54:51 +0000 | [diff] [blame] | 57 | In addition, DCAE operations depends on a Consul server cluster. For ONAP OOM deployment, since Consul cluster is provided as a shared resource, its charts are defined under the consul direcory, not part of DCAE charts. |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 58 | |
| 59 | The dcae-bootstrap job 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: |
Donald Hunter | a5683c6 | 2018-11-06 22:54:51 +0000 | [diff] [blame] | 60 | |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 61 | * dcae-cloudify-manager; |
| 62 | * consul-server; |
| 63 | * msb-discovery; |
| 64 | * kube2msb. |
| 65 | |
Vijay VK | 2648c6d | 2018-09-19 04:30:37 +0100 | [diff] [blame] | 66 | Once started, the DCAE bootstrap job will call Cloudify Manager to deploy a series of Blueprints which specify the additional DCAE R3 components. These Blueprints are almost identical to the Docker container Blueprints used by DACE R1 and Heat based R2 deployment, except that they are using the k8splugin instead of dockerplugin. The k8splugin is a major contribution of DCAE R2. It is a Cloudify Manager plugin that is capable of expanding a Docker container node definition into a Kubernetes deployment definition, with enhancements such as replica scaling, ONAP logging sidecar, MSB registration, etc. |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 67 | |
| 68 | The additional DCAE components launched into ONAP deployment are: |
Donald Hunter | a5683c6 | 2018-11-06 22:54:51 +0000 | [diff] [blame] | 69 | |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 70 | * deploy/dep-config-binding-service; |
| 71 | * deploy/dep-dcae-tca-analytics; |
| 72 | * deploy/dep-dcae-ves-collector; |
| 73 | * deploy/dep-deployment-handler; |
| 74 | * deploy/dep-holmes-engine-mgmt; |
| 75 | * deploy/dep-holmes-rule-mgmt; |
| 76 | * deploy/dep-inventory; |
| 77 | * deploy/dep-policy-handler; |
| 78 | * deploy/dep-pstg-write; |
Vijay VK | 2648c6d | 2018-09-19 04:30:37 +0100 | [diff] [blame] | 79 | * deploy/dep-service-change-handler; |
| 80 | * deploy/dep-dcae-snmptrap-collector; |
| 81 | * deploy/dep-dcae-prh; |
| 82 | * deploy/dep-dcae-hv-ves-collector. |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 83 | |
| 84 | |
| 85 | DCAE Configuration |
| 86 | ------------------ |
| 87 | |
| 88 | Deployment time configuration of DCAE components are defined in several places. |
| 89 | |
| 90 | * Helm Chart templates: |
| 91 | * Helm/Kubernetes template files can contain static values for configuration parameters; |
| 92 | * Helm Chart resources: |
| 93 | * Helm/Kubernetes resources files can contain static values for configuration parameters; |
| 94 | * Helm values.yaml files: |
| 95 | * The values.yaml files supply the values that Helm templating engine uses to expand any templates defined in Helm templates; |
| 96 | * In a Helm chart hierarchy, values defined in values.yaml files in higher level supersedes values defined in values.yaml files in lower level; |
| 97 | * Helm command line supplied values supersedes values defined in any values.yaml files. |
| 98 | |
| 99 | In addition, for DCAE components deployed through Cloudify Manager Blueprints, their configuration parameters are defined in the following places: |
Donald Hunter | a5683c6 | 2018-11-06 22:54:51 +0000 | [diff] [blame] | 100 | |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 101 | * The Blueprint files can contain static values for configuration parameters; |
| 102 | * The Blueprint files are defined under the blueprints directory of the dcaegen2/platform/blueprints repo, named with "k8s" prefix. |
| 103 | * 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): |
| 104 | * The Blueprint files can define default values for the input parameters; |
| 105 | * 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; |
| 106 | * The Blueprint input files may contain Helm templates, which are resolved into actual deployment time values following the rules for Helm values. |
| 107 | |
| 108 | |
| 109 | Now we walk through an example, how to configure the Docker image for the Policy Handler which is deployed by Cloudify Manager. |
| 110 | |
| 111 | In the k8s-policy_handler.yaml Blueprint, the Docker image to use is defined as an input parameter with a default value: |
| 112 | **policy_handler_image**: |
| 113 | description: Docker image for policy_handler |
| 114 | default: 'nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.policy-handler:2.4.3' |
| 115 | |
| 116 | Then in the input file, oom/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-policy_handler-inputs.yaml, it is defined again as: |
| 117 | **policy_handler_image**: {{ include "common.repository" . }}/{{ .Values.componentImages.policy_handler }} |
| 118 | |
| 119 | Thus, when common.repository and componentImages.policy_handler are defined in the values.yaml files, their values will be plugged in here and the composition policy_handler_image will be passed to Policy Handler Blueprint as the Docker image tag to use instead of the default value in the Blueprint. |
| 120 | |
| 121 | Indeed the componentImages.ves value is provided in the oom/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml file: |
| 122 | componentImages: |
| 123 | policy_handler: onap/org.onap.dcaegen2.platform.policy-handler:2.4.5 |
| 124 | |
| 125 | The final result is that when DCAE bootstrap calls Cloudify Manager to deploy Policy Handler, the 2.4.5 image will be deployed. |
| 126 | |
| 127 | DCAE Service Endpoints |
| 128 | ---------------------- |
| 129 | |
| 130 | Below is a table of default hostnames and ports for DCAE component service endpoints in Kuubernetes deployment: |
Donald Hunter | 1e7e2ef | 2018-11-21 14:17:28 +0000 | [diff] [blame] | 131 | ================== ================================= ====================================================== |
Vijay VK | 86cd893 | 2018-10-23 16:35:29 +0100 | [diff] [blame] | 132 | Component Cluster Internal (host:port) Cluster external (svc_name:port) |
Donald Hunter | 1e7e2ef | 2018-11-21 14:17:28 +0000 | [diff] [blame] | 133 | ================== ================================= ====================================================== |
Vijay VK | 86cd893 | 2018-10-23 16:35:29 +0100 | [diff] [blame] | 134 | VES dcae-ves-collector:8080 xdcae-ves-collector.onap:30235 |
| 135 | HV-VES dcae-hv-ves-collector:6061 xdcae-hv-ves-collector.onap:30222 |
| 136 | TCA dcae-tca-analytics:11011 xdcae-tca-analytics.onap:32010 |
Vijay VK | f6659fc | 2018-11-02 05:07:27 +0100 | [diff] [blame] | 137 | PRH dcae-prh:8100 NA |
Vijay VK | 86cd893 | 2018-10-23 16:35:29 +0100 | [diff] [blame] | 138 | DataFileCollector dcae-datafile-collector:8443/8100 xdcae-datafile-collector:8433:30224/TCP,8100:30223/TCP |
| 139 | SNMPTrap dcae-snmptrap-collector:6162/udp NA |
| 140 | Policy Handler policy-handler:25577 NA |
| 141 | Deployment Handler deployment-handler:8443 NA |
| 142 | Inventory inventory:8080 NA |
| 143 | Config binding config-binding-service:10000 NA |
| 144 | DCAE Healthcheck dcae-healthcheck:80 NA |
| 145 | Cloudify Manager dcae-cloudify-manager:80 NA |
Donald Hunter | 1e7e2ef | 2018-11-21 14:17:28 +0000 | [diff] [blame] | 146 | ================== ================================= ====================================================== |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 147 | |
Filip Krzywka | cbd2ded | 2018-09-25 14:43:18 +0200 | [diff] [blame] | 148 | In addition, a number of ONAP service endpoints that are used by DCAE components are listed as follows |
| 149 | for reference by DCAE developers and testers: |
Donald Hunter | a5683c6 | 2018-11-06 22:54:51 +0000 | [diff] [blame] | 150 | |
Filip Krzywka | cbd2ded | 2018-09-25 14:43:18 +0200 | [diff] [blame] | 151 | ==================== ============================ ================================ |
| 152 | Component Cluster Internal (host:port) Cluster external (svc_name:port) |
| 153 | ==================== ============================ ================================ |
| 154 | Consul Server consul-server:8500 consul-server:30270 |
| 155 | Robot robot:88 robot:30209 TCP |
| 156 | Message router message-router:3904 message-router:30227 |
| 157 | Message router message-router:3905 message-router:30226 |
| 158 | Message router Kafka message-router-kafka:9092 NA |
| 159 | MSB Discovery msb-discovery:10081 msb-discovery:30281 |
| 160 | Logging log-kibana:5601 log-kibana:30253 |
| 161 | AAI aai:8080 aai:30232 |
| 162 | AAI aai:8443 aai:30233 |
| 163 | ==================== ============================ ================================ |
Lusheng Ji | 768421b | 2018-06-01 16:36:54 -0400 | [diff] [blame] | 164 | |