Doc updates for London
[dcaegen2.git] / docs / sections / services / dfc / configuration.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.\r
2 .. http://creativecommons.org/licenses/by/4.0\r
3 \r
4 .. _dfc_configuration:\r
5 \r
6 =============================\r
7 Configuration and Performance\r
8 =============================\r
9 The DataFile Collector (DFC) gets fileReady messages from the Message Router (MR) sent from xNFs, via the VES Collector.\r
10 These messages contains data about files ready to get from the xNF. DFC then collects these files from the xNF and\r
11 publishes them to the DataRouter (DR) on a feed. Consumers can subscribe to the feed from DR and process the file for\r
12 its specific purpose. The connection between a file type and the feed it will be published to is the\r
13 **changeIdentifier**. DFC can handle multiple **changeIdentifier**/feed combinations, see picture below.\r
14 \r
15 .. image:: ../../images/DFC_config.png\r
16 \r
17 \r
18 \r
19 Configuration\r
20 ^^^^^^^^^^^^^\r
21 By default, DFC handles the "PM_MEAS_FILES" change identifier and publishes these files on the "bulk_pm_feed" feed.\r
22 But it can also be configured to handle more/other change identifiers and publish them to more/other feeds. The\r
23 configuration of DFC is controlled via a blueprint.\r
24 \r
25 \r
26 The user can also specify which version of DFC to use.\r
27 \r
28 .. code-block:: yaml\r
29 \r
30     image: onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:1.9.0\r
31 \r
32 The user can also enable secure communication with the DMaaP Message Router.\r
33 \r
34 .. code-block:: yaml\r
35 \r
36     dmaap.security.enableDmaapCertAuth: true\r
37 \r
38 DFC can handle multiple stream identifiers. For each stream identifier/feed combination the user must provide the\r
39 ** stream identifier**, **feed name**, and **feed location**.\r
40 \r
41 **Note!** The **feed name** provided should be used by the consumer/s to set up the subscription to the feed. \r
42 \r
43 The **stream identifier** shall be defined as an item under the **streams_publishes** tag in the "**applicationConfig**"\r
44 section. \r
45 \r
46 .. code-block:: yaml\r
47 \r
48   :emphasize-lines: 2,6\r
49       applicationConfig:\r
50                   streams_publishes:\r
51                     PM_MEAS_FILES:\r
52                       dmaap_info:\r
53                         publisher_id: ${DR_FILES_PUBLISHER_ID_0}\r
54                         location: loc00\r
55                         log_url: ${DR_LOG_URL_0}\r
56                         publish_url: ${DR_FILES_PUBLISHER_URL_0}\r
57                         username: ${DR_USERNAME}\r
58                         password: ${DR_PASSWORD}\r
59                       type: data_router\r
60                   streams_subscribes:\r
61                     dmaap_subscriber:\r
62                       dmaap_info:\r
63                         topic_url: "http://message-router:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT"\r
64                       type: message_router\r
65 \r
66 \r
67 \r
68 Under this tag the internal "**feed identifier**" for the feed shall also be added to get the\r
69 info about the feed substituted in by CBS (that's what the <<>> tags are for).\r
70 \r
71 The **feed name** and **feed location** are defined as inputs for the user to provide in helm chart values.yaml. An example snapshot on default configuration is provided below. \r
72 \r
73 .. code-block:: yaml\r
74  \r
75         # DataRouter Feed Configuration\r
76         drFeedConfig:\r
77           - feedName: bulk_pm_feed\r
78             owner: dcaecm\r
79             feedVersion: "0.0"\r
80             asprClassification: unclassified\r
81             feedDescription: DFC Feed Creation\r
82         \r
83         # DataRouter Publisher Configuration\r
84         drPubConfig:\r
85           - feedName: bulk_pm_feed\r
86             username: ${DR_USERNAME}\r
87             userpwd: ${DR_PASSWORD}\r
88             dcaeLocationName: loc00\r
89 \r
90 \r
91 .. _strict_host_checking_config:\r
92 \r
93 Turn On/Off StrictHostChecking\r
94 ------------------------------\r
95 **StrictHostChecking** is a SSH connection option which prevents Man in the Middle (MitM) attacks. If it is enabled, client checks HostName and public key provided by server and compares it with keys stored locally. Only if matching entry is found, SSH connection can be established.\r
96 By default in DataFile Collector this option is enabled (true) and requires to provide known_hosts list to DFC container.\r
97 \r
98 **Important: DFC requires public keys in sha-rsa KeyAlgorithm** \r
99 \r
100 **Known_hosts file** is a list in following format:\r
101 \r
102 .. code-block:: bash\r
103 \r
104   <HostName/HostIP> <KeyAlgorithms> <Public Key>\r
105 \r
106 e.g: \r
107 \r
108 .. code-block:: bash\r
109 \r
110   172.17.0.3 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDRibxPenQC//2hzTuscdQDUA7P3gB9k4E8IgwCJxZM8YrJ2vqHomN8boByubebvo0L8+DWqzAtjy0nvgzsoEme9Y3lLWZ/2g9stlsOurwm+nFmWn/RPnwjqsAGNQjukV8C9D82rPMOYRES6qSGactFw4i8ZWLH8pmuJ3js1jb91HSlwr4zbZZd2XPKHk3nudyh8/Mwf3rndCU5FSnzjpBo55m48nsl2M1Tb6Xj1R0jQc5LWN0fsbrm5m+szsk4ccgHw6Vj9dr0Jh4EaIpNwA68k4LzrWb/N20bW8NzUsyDSQK8oEo1dvsiw8G9/AogBjQu9N4bqKWcrk5DOLCZHiCTSbbvdMWAMHXBdxEt9GZ0V53Fzwm8fI2EmIHdLhI4BWKZajumsfHRnd6UUxxna9ySt6qxVYZTyrPvfOFR3hRxVaxHL3EXplGeHT8fnoj+viai+TeSDdjMNwqU4MrngzrNKNLBHIl705uASpHUaRYQxUfWw/zgKeYlIbH+aGgE+4Q1vnh10Y35pATePRZgBIu+h2KsYBAtrP88LqW562OQ6T7VkfoAYwOjx9WV3/y5qonsStPhhzmJHDF22oBh5E5tZQxRcIlQF+5kHmXnFRUZtWshFnQATBh3yhOzJbh66CXn7aPj5Kl8TuuSN48zuI2lulVVqcv7GmTS0tWNpbxpzw==\r
111 \r
112 HostName could also be hashed, e.g:\r
113 \r
114 .. code-block:: bash\r
115 \r
116   |1|FwSOxXYeJyZMAQM3jREjLSIcxRw=|o/b+CHEeHuED7WZS6sb3Y1IyHjk= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDRibxPenQC//2hzTuscdQDUA7P3gB9k4E8IgwCJxZM8YrJ2vqHomN8boByubebvo0L8+DWqzAtjy0nvgzsoEme9Y3lLWZ/2g9stlsOurwm+nFmWn/RPnwjqsAGNQjukV8C9D82rPMOYRES6qSGactFw4i8ZWLH8pmuJ3js1jb91HSlwr4zbZZd2XPKHk3nudyh8/Mwf3rndCU5FSnzjpBo55m48nsl2M1Tb6Xj1R0jQc5LWN0fsbrm5m+szsk4ccgHw6Vj9dr0Jh4EaIpNwA68k4LzrWb/N20bW8NzUsyDSQK8oEo1dvsiw8G9/AogBjQu9N4bqKWcrk5DOLCZHiCTSbbvdMWAMHXBdxEt9GZ0V53Fzwm8fI2EmIHdLhI4BWKZajumsfHRnd6UUxxna9ySt6qxVYZTyrPvfOFR3hRxVaxHL3EXplGeHT8fnoj+viai+TeSDdjMNwqU4MrngzrNKNLBHIl705uASpHUaRYQxUfWw/zgKeYlIbH+aGgE+4Q1vnh10Y35pATePRZgBIu+h2KsYBAtrP88LqW562OQ6T7VkfoAYwOjx9WV3/y5qonsStPhhzmJHDF22oBh5E5tZQxRcIlQF+5kHmXnFRUZtWshFnQATBh3yhOzJbh66CXn7aPj5Kl8TuuSN48zuI2lulVVqcv7GmTS0tWNpbxpzw==\r
117 \r
118 \r
119 \r
120 To provide known_hosts list to DFC, execute following steps:\r
121 \r
122 1. Create file called known_hosts with desired entries.\r
123 \r
124 2. Mount file using Kubernetes Config Map.\r
125 \r
126 .. code-block:: bash\r
127 \r
128   kubectl -n <ONAP NAMESPACE> create cm <config map name> --from-file <path to known_hosts file>\r
129 \r
130 e.g:\r
131 \r
132 .. code-block:: bash\r
133 \r
134   kubectl -n onap create cm onap-dcae-dfc-known-hosts --from-file /home/ubuntu/.ssh/known_hosts\r
135 \r
136 \r
137 3. Mount newly created Config Map as Volume to DFC by editing DFC deployment. **DFC deployment contains 3 containers, pay attention to mount the file to the appropriate container.**\r
138 \r
139 .. code-block:: yaml\r
140   \r
141   ...\r
142   kind: Deployment\r
143   metadata:\r
144   ...\r
145   spec:\r
146     ...\r
147     template:\r
148       ...\r
149       spec:\r
150         containers:\r
151         - image: <DFC image>\r
152           ...\r
153           volumeMounts:\r
154             ...\r
155           - mountPath: /home/datafile/.ssh/\r
156             name: onap-dcae-dfc-known-hosts\r
157             ...\r
158         volumes:\r
159         ...\r
160         - configMap:\r
161             name: <config map name, same as in step 1, e.g. onap-dcae-dfc-known-hosts>\r
162           name: onap-dcae-dfc-known-hosts\r
163       ...\r
164 \r
165 Known_hosts file path can be controlled by Environment Variable *KNOWN_HOSTS_FILE_PATH*. Full (absolute) path has to be provided. Sample deployment with changed known_hosts file path can be seen below.\r
166 \r
167 .. code-block:: yaml\r
168   \r
169   ...\r
170   kind: Deployment\r
171   metadata:\r
172   ...\r
173   spec:\r
174     ...\r
175     template:\r
176       ...\r
177       spec:\r
178         containers:\r
179         - image: <DFC image>\r
180           envs: \r
181             - name: KNOWN_HOSTS_FILE_PATH\r
182               value: /home/datafile/.ssh/new/path/<known_hosts file name, e.g. my_custom_keys>\r
183           ...\r
184           volumeMounts:\r
185             ...\r
186           - mountPath: /home/datafile/.ssh/new/path\r
187             name: onap-dcae-dfc-known-hosts\r
188             ...\r
189         volumes:\r
190         ...\r
191         - configMap:\r
192             name: <config map name, same as in step 1, e.g. onap-dcae-dfc-known-hosts>\r
193           name: onap-dcae-dfc-known-hosts\r
194       ...\r
195 \r
196 To change mounted known_hosts list, edit existing Config Map or delete and create it again. **The DFC container may refresh changes with a delay.** Pod, nor container restart is NOT required.\r
197 \r
198 To edit Config Map execute:\r
199 \r
200 .. code-block:: bash\r
201 \r
202   kubectl -n <ONAP NAMESPACE> edit cm <config map name>\r
203 \r
204 e.g:\r
205 \r
206 .. code-block:: bash\r
207 \r
208    kubectl -n onap edit cm onap-dcae-dfc-known-hosts\r
209 \r
210 To delete and create again Config Map execute: \r
211 \r
212 .. code-block:: bash\r
213 \r
214   kubectl -n <ONAP NAMESPACE> delete cm <config map name>\r
215   kubectl -n <ONAP NAMESPACE> create cm <config map name> --from-file <path to known_hosts file>\r
216 \r
217 e.g:\r
218 \r
219 .. code-block:: bash\r
220 \r
221   kubectl -n onap delete cm onap-dcae-dfc-known-hosts\r
222   kubectl -n onap create cm onap-dcae-dfc-known-hosts --from-file /home/ubuntu/.ssh/known_hosts\r
223 \r
224 \r
225 To turn off StrictHostChecking, set below option to false. It could be changed in DCAE Config Binding Service (CBS).\r
226 \r
227 **WARNING: such operation is not recommended as it decreases DFC security and exposes DFC to MitM attacks.**\r
228 \r
229 .. code-block:: bash\r
230 \r
231   "sftp.security.strictHostKeyChecking": false\r
232 \r
233 \r
234 \r
235 Disable TLS connection\r
236 ----------------------\r
237 The TLS connection in the external interface is enabled by default. To disable TLS, use the following application property:\r
238 \r
239 .. code-block:: bash\r
240 \r
241   "dmaap.certificateConfig.enableCertAuth": false\r
242 \r
243 \r
244 \r
245 Performance\r
246 ^^^^^^^^^^^\r
247 \r
248 To see the performance of DFC, see "`Datafile Collector (DFC) performance baseline results`_".\r
249 \r
250 .. _Datafile Collector (DFC) performance baseline results: https://wiki.onap.org/display/DW/Datafile+Collector+%28DFC%29+performance+baseline+results\r