update link to upper-constraints.txt
[dcaegen2.git] / docs / sections / healthcheck.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. _healthcheck:
4
5 DCAE Health Check
6 =================
7
8
9 HealthCheck Services
10 --------------------
11
12 DCAE healthchecks are performed by a separate service.
13
14 - dcae-ms-healthcheck
15
16 These service is packaged into a Docker image (``onap/org.onap.dcaegen2.deployments.healthcheck-container``),
17 which is built in the ``healthcheck-container`` module in the ``dcaegen2/deployments`` repository.
18
19 dcae-ms-healthcheck is deployed along with services enabled under (``oom/kubernetes/dcaegen2-services``)
20
21 This healthcheck container runs as service that exposes a simple Web API.  In response to
22 request, the service checks Kubernetes to verify that all of the expected
23 DCAE platform and service components are in a ready state.
24
25 The service has a fixed list service components identified by json file -  `expected-components.json <https://github.com/onap/oom/blob/master/kubernetes/dcaegen2-services/resources/expected-components.json>`_
26 ; these are normally deployed when dcaegen2-services is installed. In addition, the healthcheck service also tracks and checks components that are deployed dynamically after the initial DCAE installation.
27
28 The healthcheck service is exposed as a Kubernetes ClusterIP Service named
29 `dcae-ms-healthcheck`.   The service can be queried for status as shown below.
30
31 .. note::
32   Run the below commands before running "curl dcae-ms-healthcheck"
33
34   * To get the dcae-ms-healthcheck pod name, run following command:
35
36 .. code-block:: bash
37
38     kubectl  get pods -n onap | grep dcae-ms-healthcheck
39
40   * Then enter in to the shell of the container, run the following command (substituting the pod name retrieved by the previous command):
41
42 .. code-block:: bash
43
44     kubectl exec -it <dcae-ms-healthcheck pod> -n onap bash
45
46
47 .. code-block:: bash
48
49    $ curl dcae-ms-healthcheck
50    {
51       "type": "summary",
52       "count": 5,
53       "ready": 5,
54       "items": [{
55             "name": "onap-dcae-hv-ves-collector",
56             "ready": 1,
57             "unavailable": 0
58        },
59        {
60             "name": "onap-dcae-prh",
61             "ready": 1,
62             "unavailable": 0
63        },
64        {
65             "name": "onap-dcae-tcagen2",
66             "ready": 1,
67             "unavailable": 0
68        },
69        {
70             "name": "onap-dcae-ves-collector",
71             "ready": 1,
72             "unavailable": 0
73        },
74        {
75             "name": "onap-dcae-ves-openapi-manager",
76             "ready": 1,
77             "unavailable": 0
78        }
79     ]
80    }