Add Helm installation guide for KPI MS
[dcaegen2.git] / docs / sections / services / kpi-computation-ms / installation-helm.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. _kpi-installation-helm:
4
5
6 Helm Installation
7 =================
8
9 Kpi Computation microservice can be deployed using helm charts in oom repository.
10
11
12 Deployment Pre-requisites
13 ~~~~~~~~~~~~~~~~~~~~~~~~~
14 - DMaaP pods should be up and running.
15
16 - PM mapper service should be running.
17
18 - Policy pods should be running.
19
20 - Required policies should be created and pushed to the policy component. Steps for creating and pushing policy models:
21
22      1. Log in to policy-drools-pdp-0 container
23
24              .. code-block:: bash
25
26                kubectl exec -ti --namespace <namespace> policy-pdp-0 bash
27
28
29      2. Create policy type:
30
31              .. code-block:: bash
32
33               curl -k --silent --user 'healthcheck:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"policy_types":{"onap.policies.monitoring.docker.kpims.app":{"derived_from":"onap.policies.Monitoring:1.0.0","description":"KPI ms policy type","properties":{"domain":{"required":true,"type":"string"},"methodForKpi":{"type":"list","required":true,"entry_schema":{"type":"policy.data.methodForKpi_properties"}}},"version":"1.0.0"}},"data_types":{"policy.data.methodForKpi_properties":{"derived_from":"tosca.nodes.Root","properties":{"eventName":{"type":"string","required":true},"controlLoopSchemaType":{"type":"string","required":true},"policyScope":{"type":"string","required":true},"policyName":{"type":"string","required":true},"policyVersion":{"type":"string","required":true},"kpis":{"type":"list","required":true,"entry_schema":{"type":"policy.data.kpis_properties"}}}},"policy.data.kpis_properties":{"derived_from":"tosca.nodes.Root","properties":{"measType":{"type":"string","required":true},"operation":{"type":"string","required":true},"operands":{"type":"string","required":true}}}},"tosca_definitions_version":"tosca_simple_yaml_1_1_0"}'
34
35      3. Create monitoring policy:
36
37              .. code-block:: bash
38
39               curl -k --user 'healthcheck:zb!XztG34' -X POST "https://policy-api:6969/policy/api/v1/policytypes/onap.policies.monitoring.docker.kpims.app/versions/1.0.0/policies" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"name":"ToscaServiceTemplateSimple","topology_template":{"policies":[{"com.Config_KPIMS_CONFIG_POLICY":{"type":"onap.policies.monitoring.docker.kpims.app","type_version":"1.0.0","version":"1.0.0","metadata":{"policy-id":"com.Config_KPIMS_CONFIG_POLICY","policy-version":"1"},"name":"com.Config_KPIMS_CONFIG_POLICY","properties":{"domain":"measurementsForKpi","methodForKpi":[{"eventName":"perf3gpp_CORE-AMF_pmMeasResult","controlLoopSchemaType":"SLICE","policyScope":"resource=networkSlice;type=configuration","policyName":"configuration.dcae.microservice.kpi-computation","policyVersion":"v0.0.1","kpis":[{"measType":"AMFRegNbr","operation":"SUM","operands":"RM.RegisteredSubNbrMean"}]},{"eventName":"perf3gpp_CORE-UPF_pmMeasResult","controlLoopSchemaType":"SLICE","policyScope":"resource=networkSlice;type=configuration","policyName":"configuration.dcae.microservice.kpi-computation","policyVersion":"v0.0.1","kpis":[{"measType":"UpstreamThr","operation":"SUM","operands":"GTP.InDataOctN3UPF"},{"measType":"DownstreamThr","operation":"SUM","operands":"GTP.OutDataOctN3UPF"}]}]}}}]},"tosca_definitions_version":"tosca_simple_yaml_1_1_0","version":"1.0.0"}'
40
41
42      4. Push monitoring policy:
43
44              .. code-block:: bash
45
46                curl --silent -k --user 'healthcheck:zb!XztG34' -X POST "https://policy-pap:6969/policy/pap/v1/pdps/policies" -H "Accept: application/json" -H "Content-Type: application/json" --data '{"policies":[{"policy-id":"com.Config_KPIMS_CONFIG_POLICY","policy-version":1}]}'
47
48 Deployment steps
49 ~~~~~~~~~~~~~~~~
50
51 - Default app config values can be updated in oom/kubernetes/dcaegen2-services/components/dcae-kpi-ms/values.yaml.
52
53 - Update monitoring policy ID in below configuration which is used to enable Policy-Sync Side car container to be deployed and retrieves active policy configuration.
54
55   .. code-block :: bash
56
57     dcaePolicySyncImage: onap/org.onap.dcaegen2.deployments.dcae-services-policy-sync:1.0.1
58     policies:
59     policyID:  |
60         '["com.Config_KPIMS_CONFIG_POLICY"]'
61
62 - Enable KPI MS component in oom/kubernetes/dcaegen2-services/values.yaml
63
64   .. code-block:: bash
65
66     dcae-kpi-ms:
67       enabled: true
68
69 - Make the chart and deploy using the following command:
70
71   .. code-block:: bash
72
73     cd oom/kubernetes/
74     make dcaegen2-services
75     helm install dev-dcaegen2-services dcaegen2-services --namespace <namespace> --set global.masterPassword=<password>
76
77 - To deploy only KPI MS:
78
79   .. code-block:: bash
80
81     helm install dev-dcae-kpi-ms dcaegen2-services/components/dcae-kpi-ms --namespace <namespace> --set global.masterPassword=<password>
82
83 - To Uninstall
84
85   .. code-block:: bash
86
87     helm uninstall dev-dcae-kpi-ms
88
89
90 Application Configurations
91 --------------------------
92 +-------------------------------+------------------------------------------------+
93 |Configuration                  | Description                                    |
94 +===============================+================================================+
95 |Streams_subscribes             | Dmaap topics that the MS will consume messages |
96 +-------------------------------+------------------------------------------------+
97 |Streams_publishes              | Dmaap topics that the MS will publish messages |
98 +-------------------------------+------------------------------------------------+
99 |cbsPollingInterval             | Polling Interval for consuming config data from|
100 |                               | CBS                                            |
101 +-------------------------------+------------------------------------------------+
102 |pollingInterval                | Polling Interval for consuming dmaap messages  |
103 +-------------------------------+------------------------------------------------+
104 |pollingTimeout                 | Polling timeout for consuming dmaap messages   |
105 +-------------------------------+------------------------------------------------+
106 |dmaap.server                   | Location of message routers                    |
107 +-------------------------------+------------------------------------------------+
108 |cg                             | DMAAP Consumer group for subscription          |
109 +-------------------------------+------------------------------------------------+
110 |cid                            | DMAAP Consumer id for subscription             |
111 +-------------------------------+------------------------------------------------+
112 |trust_store_path               | Location of trust.jks file                     |
113 +-------------------------------+------------------------------------------------+
114 |trust_store_pass_path          | Location of trust.pass file                    |
115 +-------------------------------+------------------------------------------------+