blob: 7e8ebf0414d5fcc8bb11eea2a1822804f88cb124 [file] [log] [blame]
Petr Ospalýbe81ab02019-02-14 21:30:31 +01001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2019 Samsung Electronics Co., Ltd.
4
5.. _oooi_installguide:
6
7OOM ONAP Offline Installer - Installation Guide
8===============================================
9
10This document describes the correct offline installation procedure for `OOM ONAP`_, which is done by the ansible based `offline-installer <https://gerrit.onap.org/r/#/admin/projects/oom/offline-installer>`_.
11
12Before you dive into the installation you should prepare the offline installer itself - the installer consists of at least two packages/resources. You can read about it in the `Build Guide`_, which provides the instructions for creating them.
13
14This current version of the *Installation Guide* supports `Casablanca release`_.
15
16-----
17
18.. _oooi_installguide_preparations:
19
20Part 1. Prerequisites
21---------------------
22
23OOM ONAP deployment has certain hardware resource requirements - `Casablanca requirements`_:
24
25- 14 VM (1 Rancher, 13 K8s nodes) - 8 vCPU - 16 GB RAM
26- 160 GB Storage
27
28That means the full deployment footprint is about ``224 GB RAM`` and ``112 vCPUs``. We will not follow strictly this setup due to such demanding resource consumption and so we will deploy our installation across four nodes (VMs) instead of fourteen. Our simplified setup is definitively not supported or recommended - you are free to diverge - you can follow the official guidelines or make completely different layout, but the minimal count of nodes should not drop below three - otherwise you may have to do some tweaking to make it work, which is not covered here (there is a pod count limit for a single kubernetes node - you can read more about it in this `discussion <https://lists.onap.org/g/onap-discuss/topic/oom_110_kubernetes_pod/25213556>`_).
29
30.. _oooi_installguide_preparations_k8s_cluster:
31
32Kubernetes cluster
33~~~~~~~~~~~~~~~~~~
34
35The four nodes/VMs will be running these services:
36
37- **infra-node**::
38
39 - nexus
40 - nginx proxy
41 - dns
42 - rancher server
43
44- **kubernetes node 1-3**::
45
46 - rancher agent
47
48You don't need to care about these services now - that is the responsibility of the installer (described below). Just start four VMs as seen in this table (or according to your needs as we hinted above):
49
50.. _Overview table of the kubernetes cluster:
51
52Kubernetes cluster overview
53^^^^^^^^^^^^^^^^^^^^^^^^^^^
54
55=================== ========= ==================== ============== ============ ===============
56KUBERNETES NODE OS NETWORK CPU RAM STORAGE
57=================== ========= ==================== ============== ============ ===============
58**infra-node** RHEL 7 ``10.8.8.100/24`` ``8 vCPUs`` ``8 GB`` ``100 GB``
59**kube-node1** RHEL 7 ``10.8.8.101/24`` ``16 vCPUs`` ``48+ GB`` ``100 GB``
60**kube-node2** RHEL 7 ``10.8.8.102/24`` ``16 vCPUs`` ``48+ GB`` ``100 GB``
61**kube-node3** RHEL 7 ``10.8.8.103/24`` ``16 vCPUs`` ``48+ GB`` ``100 GB``
62SUM ``56 vCPUs`` ``152+ GB`` ``400 GB``
63================================================== ============== ============ ===============
64
65Unfortunately, the offline installer supports only **RHEL 7.x** distribution as of now. So, your VMs should be preinstalled with this operating system - the hypervisor and platform can be of your choosing. It is also worth knowing that the exact RHEL version (major and minor number - 7.6 for example) should match for the package build procedure and the target installation. That means: if you are building packages on RHEL 7.6 release your VMs should be RHEL 7.6 too.
66
67We will expect from now on that you installed four VMs and they are connected to the shared network. All VMs must be reachable from our *install-server* (below), which can be the hypervisor, *infra-node* or completely different machine. But in either of these cases the *install-server* must be able to connect over ssh to all of these nodes.
68
69.. _oooi_installguide_preparations_installserver:
70
71Install-server
72~~~~~~~~~~~~~~
73
74We will use distinct *install-server* and keep it separate from the four-node cluster. But if you wish so, you can use *infra-node* for this goal (if you use the default ``'chroot'`` option of the installer), but in that case double the size of the storage requirement!
75
76Prerequisites for the *install-server*:
77
78- packages described in `Build Guide`_
79- extra ``100 GB`` storage (to have space where to store these packages)
80- installed ``'chroot'`` and/or ``'docker'`` system commands
81- network connection to the nodes - especially functioning ssh client
82
83Our *install-server* will have ip: ``10.8.8.4``.
84
85**NOTE:** All the subsequent commands below, are executed from within this *install-server*.
86
87-----
88
89.. _oooi_installguide_config:
90
91Part 2. Preparation and configuration
92-------------------------------------
93
94We *MUST* do all the following instructions from the *install-server* and also we will be running them as a user ``root``. But that is not necessary - you can without any problem pick and use a regular user. The ssh/ansible connection to the nodes will also expect that we are connecting as a ``root`` - you need to elevate privileges to be able to install on them. Although it can be achieved by other means (sudo), we decided here to keep instructions simple.
95
96.. _oooi_installguide_config_packages:
97
98Installer packages
99~~~~~~~~~~~~~~~~~~
100
101As was stated above you must have prepared the installer packages (names will differ - check out the `Build Guide`_):
102
Michal Ptaceke45f3a52019-05-07 07:38:40 +0000103- offline-onap-3.0.2-resources.tar
104- offline-onap-3.0.2-aux-resources.tar
105- offline-onap-3.0.2-sw.tar
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100106
Michal Ptaceke45f3a52019-05-07 07:38:40 +0000107**NOTE:** ``'offline-onap-3.0.2-aux-resources.tar'`` is optional and if you don't have use for it, you can ignore it.
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100108
109We will store them in the ``/data`` directory on the *install-server* and then we will unpack the ``'sw'`` package to your home directory for example::
110
111 $ mkdir ~/onap-offline-installer
Michal Ptaceke45f3a52019-05-07 07:38:40 +0000112 $ tar -C ~/onap-offline-installer -xf /data/offline-onap-3.0.2-sw.tar
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100113
114.. _oooi_installguide_config_app:
115
116Application directory
117~~~~~~~~~~~~~~~~~~~~~
118
119Change the current directory to the ``'ansible'``::
120
121 $ cd ~/onap-offline-installer/ansible
122
123You can see multiple files and directories inside - this is the *offline-installer*. It is implemented as a set of ansible playbooks.
124
Bartek Grzybowski30b2cbf2019-03-26 16:10:10 +0100125If you created the ``'sw'`` package according to the *Build Guide* then you should have had the ``'application'`` directory populated with at least the following files:
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100126
127- ``application_configuration.yml``
128- ``hosts.yml``
129
130**NOTE:** The following paragraph describes a way how to create or fine-tune your own ``'application_configuration.yml'`` - we are discouraging you from executing this step. The recommended way is to use the packaged files inside the ``'application'`` directory.
131
132**NOT RECOMMENDED:** If for some reason you don't have these files inside the ``'application'`` directory or you simply want to do things the hard way then you can recreate them from their templates. It is better to keep the originals (templates) intact - so we will copy them to the ``'application'`` directory::
133
134 $ cp ../config/application_configuration.yml application/
135 $ cp inventory/hosts.yml application/
136
137.. _oooi_installguide_config_hosts:
138
139hosts.yml
140~~~~~~~~~
141
142We need to setup the ``'hosts.yml'`` first, the template looks like this::
143
144 ---
145 # This group contains hosts with all resources (binaries, packages, etc.)
146 # in tarball.
147 all:
148 vars:
149 # this key is supposed to be generated during setup.yml playbook execution
150 # change it just when you have better one working for all nodes
151 ansible_ssh_private_key_file: /root/.ssh/offline_ssh_key
152 ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
153
154 children:
155 resources:
156 hosts:
157 resource-host:
158 ansible_host: 10.8.8.5
159
160 # This is group of hosts where nexus, nginx, dns and all other required
161 # services are running.
162 infrastructure:
163 hosts:
164 infrastructure-server:
165 ansible_host: 10.8.8.13
166 #IP used for communication between infra and kubernetes nodes, must be specified.
167 cluster_ip: 10.8.8.13
168
169 # This is group of hosts which are/will be part of Kubernetes cluster.
170 kubernetes:
Michal Zeganf9ef0c12019-06-25 11:05:05 +0200171 children:
172 # This is a group of hosts containing kubernetes worker nodes.
173 kubernetes-node:
174 hosts:
175 kubernetes-node-1:
176 ansible_host: 10.8.8.19
177 #ip of the node that it uses for communication with k8s cluster.
178 cluster_ip: 10.8.8.19
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100179
Michal Zeganf9ef0c12019-06-25 11:05:05 +0200180 # Group of hosts containing etcd cluster nodes.
181 # Defaults to infra.
182 kubernetes-etcd:
183 hosts:
184 infrastructure-server
185
186 # This is a group of hosts that are to be used as kubernetes control plane nodes.
187 # This means they host kubernetes api server, controller manager and scheduler.
188 # This example uses infra for this purpose, however note that any
189 # other host could be used including kubernetes nodes.
190 # cluster_ip needs to be set for hosts used as control planes.
191 kubernetes-control-plane:
192 hosts:
193 infrastructure-server
Bartek Grzybowskicf6797c2019-05-22 14:53:31 +0200194
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100195 nfs-server:
196 hosts:
197 kubernetes-node-1
198
199There is some ssh configuration under the ``'vars'`` section - we will deal with ssh setup a little bit later in the `SSH authentication`_.
200
201We need to first correct the ip addresses and add a couple of kubernetes nodes to match our four-node cluster:
202
203- Under the ``'resource-host'`` set the ``'ansible_host'`` address to the ip of your server, where the packages are stored - it must be reachable by ssh from the *install-server* (for ansible to run playbooks on it) **AND** *infra-node* (to extract resource data from *resource-host* to *infra-node* over ssh). In our scenario the *resource-host* is the same as the *install-server*: ``'10.8.8.4'``
204- Similarly, set the ``'ansible_host'`` to the address of the *infra-node* under the ``'infrastructure-server'``.
205- Copy the whole ``'kubernetes-node-1'`` subsection and paste it twice directly after. Change the numbers to ``'kubernetes-node-2'`` and ``'kubernetes-node-3'`` respectively and fix the addresses in the ``'ansible_host'`` variables again to match *kube-node1*, *kube-node2* and *kube-node3*.
206
207As you can see, there is another ``'cluster_ip'`` variable for each node - this serve as a designated node address in the kubernetes cluster. Make it the same as the respective ``'ansible_host'``.
208
209**NOTE:** In our simple setup we have only one interface per node, but that does not need to be a case for some other deployment - especially if we start to deal with a production usage. Basically, an ``'ansible_host'`` is an entry point for the *install-server's* ansible (*offline-installer*), but the kubernetes cluster can be communicating on a separate network to which *install-server* has no access. That is why we have this distinctive variable, so we can tell the installer that there is a different network, where we want to run the kubernetes traffic and what address each node has on such a network.
210
211After all the changes, the ``'hosts.yml'`` should look similar to this::
212
213 ---
214 # This group contains hosts with all resources (binaries, packages, etc.)
215 # in tarball.
216 all:
217 vars:
218 # this key is supposed to be generated during setup.yml playbook execution
219 # change it just when you have better one working for all nodes
220 ansible_ssh_private_key_file: /root/.ssh/offline_ssh_key
221 ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
222
223 children:
224 resources:
225 hosts:
226 resource-host:
227 ansible_host: 10.8.8.4
228
229 # This is group of hosts where nexus, nginx, dns and all other required
230 # services are running.
231 infrastructure:
232 hosts:
233 infrastructure-server:
Michal Zeganf9ef0c12019-06-25 11:05:05 +0200234 ansible_host: 10.8.8.13
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100235 #IP used for communication between infra and kubernetes nodes, must be specified.
236 cluster_ip: 10.8.8.100
237
238 # This is group of hosts which are/will be part of Kubernetes cluster.
239 kubernetes:
Michal Zeganf9ef0c12019-06-25 11:05:05 +0200240 children:
241 # This is a group of hosts containing kubernetes worker nodes.
242 kubernetes-node:
243 hosts:
244 kubernetes-node-1:
245 ansible_host: 10.8.8.101
246 #ip of the node that it uses for communication with k8s cluster.
247 cluster_ip: 10.8.8.101
248 kubernetes-node-2:
249 ansible_host: 10.8.8.102
250 #ip of the node that it uses for communication with k8s cluster.
251 cluster_ip: 10.8.8.102
252 kubernetes-node-3:
253 ansible_host: 10.8.8.103
254 #ip of the node that it uses for communication with k8s cluster.
255 cluster_ip: 10.8.8.103
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100256
Michal Zeganf9ef0c12019-06-25 11:05:05 +0200257 # Group of hosts containing etcd cluster nodes.
258 # Defaults to infra.
259 kubernetes-etcd:
260 hosts:
261 infrastructure-server
262
263 # This is a group of hosts that are to be used as kubernetes control plane nodes.
264 # This means they host kubernetes api server, controller manager and scheduler.
265 # This example uses infra for this purpose, however note that any
266 # other host could be used including kubernetes nodes.
267 # cluster_ip needs to be set for hosts used as control planes.
268 kubernetes-control-plane:
269 hosts:
270 infrastructure-server
Bartek Grzybowskicf6797c2019-05-22 14:53:31 +0200271
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100272 nfs-server:
273 hosts:
274 kubernetes-node-1
275
276.. _oooi_installguide_config_appconfig:
277
278application_configuration.yml
279~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
280
281Here, we will be interested in the following variables:
282
283- ``resources_dir``
284- ``resources_filename``
285- ``aux_resources_filename``
286- ``app_data_path``
287- ``aux_data_path``
288- ``app_name``
Bartek Grzybowski30b2cbf2019-03-26 16:10:10 +0100289- ``timesync``
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100290
291``'resource_dir'``, ``'resources_filename'`` and ``'aux_resources_filename'`` must correspond to the file paths on the *resource-host* (variable ``'resource_host'``), which is in our case the *install-server*.
292
Michal Ptaceke45f3a52019-05-07 07:38:40 +0000293The ``'resource_dir'`` should be set to ``'/data'``, ``'resources_filename'`` to ``'offline-onap-3.0.2-resources.tar'`` and ``'aux_resources_filename'`` to ``'offline-onap-3.0.2-aux-resources.tar'``. The values should be the same as are in the `Installer packages`_ section.
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100294
Michal Ptaceke45f3a52019-05-07 07:38:40 +0000295``'app_data_path'`` is the absolute path on the *infra-node* to where the package ``'offline-onap-3.0.2-resources.tar'`` will be extracted and similarly ``'aux_data_path'`` is another absolute path for ``'offline-onap-3.0.2-aux-resources.tar'``. Both the paths are fully arbitrary, but they should point to the filesystem with enough space - the storage requirement in `Overview table of the kubernetes cluster`_.
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100296
297**NOTE:** As we mentioned in `Installer packages`_ - the auxiliary package is not mandatory and we will not utilize it in here either.
298
Bartek Grzybowski30b2cbf2019-03-26 16:10:10 +0100299The ``'app_name'`` variable should be short and descriptive. We will set it simply to: ``onap``.
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100300
Bartek Grzybowski30b2cbf2019-03-26 16:10:10 +0100301The ``'timesync'`` variable is optional and controls synchronisation of the system clock on hosts. It should be configured only if a custom NTP server is available and needed. Such a time authority should be on a host reachable from all installation nodes. If this setting is not provided then the default behavior is to setup NTP daemon on infra-node and sync all kube-nodes' time with it.
302
303If you wish to provide your own NTP servers configure their IPs as follows::
304
305 timesync:
306 servers:
307 - <ip address of NTP_1>
308 - <...>
309 - <ip address of NTP_N>
310
311Another time adjustment related variables are ``'timesync.slewclock'`` and ``'timesync.timezone'`` .
312First one can have value of ``'true'`` or ``'false'`` (default). It controls whether (in case of big time difference compared to server) time should be adjusted gradually by slowing down or speeding up the clock as required (``'true'``) or in one step (``'false'``)::
313
314 timesync:
315 slewclock: true
316
317Second one controls time zone setting on host. It's value should be time zone name according to tz database names with ``'Universal'`` being the default one::
318
319 timesync.
320 timezone: UTC
321
322``'timesync.servers'``, ``'timesync.slewclock'`` and ``'timesync.timezone'`` settings can be used independently.
323
324Final configuration can resemble the following::
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100325
326 resources_dir: /data
Michal Ptaceke45f3a52019-05-07 07:38:40 +0000327 resources_filename: offline-onap-3.0.2-resources.tar
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100328 app_data_path: /opt/onap
329 app_name: onap
Bartek Grzybowski30b2cbf2019-03-26 16:10:10 +0100330 timesync:
331 servers:
332 - 192.168.0.1
333 - 192.168.0.2
334 slewclock: true
335 timezone: UTC
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100336
Michal Zegana579c982019-04-02 15:33:30 +0200337.. _oooi_installguide_config_appconfig_overrides:
338
339Helm chart value overrides
340^^^^^^^^^^^^^^^^^^^^^^^^^^
341
342If there is a need to change onap settings such as managed openstack credentials, service ports, or even docker image versions used, you can do this by putting settings under the ``overrides`` key in ``application_configuration.yml``.
343These settings will override helm values originally stored in ``values.yaml`` files in helm chart directories.
344
345For example, the following lines could be appended to ``application_configuration.yml`` to set up managed openstack credentials for onap's so component::
346
347 overrides:
348 so:
349 config:
350 openStackUserName: "os_user"
351 openStackRegion: "region_name"
352 openStackKeyStoneUrl: "keystone_url"
353 openStackEncryptedPasswordHere: "encrypted_password"
354
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100355.. _oooi_installguide_config_ssh:
356
357SSH authentication
358~~~~~~~~~~~~~~~~~~
359
360We are almost finished with the configuration and we are close to start the installation, but we need to setup password-less login from *install-server* to the nodes.
361
362You can use the ansible playbook ``'setup.yml'`` like this::
363
364 $ ./run_playbook.sh -i application/hosts.yml setup.yml -u root --ask-pass
365
366You will be asked for password per each node and the playbook will generate a unprotected ssh key-pair ``'~/.ssh/offline_ssh_key'``, which will be distributed to the nodes.
367
368Another option is to generate a ssh key-pair manually. We strongly advise you to protect it with a passphrase, but for simplicity we will showcase generating of a private key without any such protection::
369
370 $ ssh-keygen -N "" -f ~/.ssh/identity
371
372The next step will be to distribute the public key to these nodes and from that point no password is needed::
373
374 $ for ip in 100 101 102 103 ; do ssh-copy-id -i ~/.ssh/identity.pub root@10.8.8.${ip} ; done
375
376This command behaves almost identically to the ``'setup.yml'`` playbook.
377
378If you generated the ssh key manually then you can now run the ``'setup.yml'`` playbook like this and achieve the same result as in the first execution::
379
380 $ ./run_playbook.sh -i application/hosts.yml setup.yml
381
382This time it should not ask you for any password - of course this is very redundant, because you just distributed two ssh keys for no good reason.
383
384We can finally edit and finish the configuration of the ``'hosts.yml'``:
385
386- if you used the ``'setup.yml'`` playbook then you can just leave this line as it is::
387
388 ansible_ssh_private_key_file: /root/.ssh/offline_ssh_key
389
390- if you created a ssh key manually then change it like this::
391
392 ansible_ssh_private_key_file: /root/.ssh/identity
393
394-----
395
396.. _oooi_installguide_install:
397
398Part 3. Installation
399--------------------
400
401We should have the configuration complete and be ready to start the installation. The installation is done via ansible playbooks, which are run either inside a **chroot** environment (default) or from the **docker** container. If for some reason you want to run playbooks from the docker instead of chroot then you cannot use *infra-node* or any other *kube-node* as the *install-server* - otherwise you risk that installation will fail due to restarting of the docker service.
402
403If you built your ``'sw'`` package well then there should be the file ``'ansible_chroot.tgz'`` inside the ``'docker'`` directory. If not then you must create it - to learn how to do that and to get more info about the scripts dealing with docker and chroot, go to `Appendix 1. Ansible execution/bootstrap`_
404
405We will use the default chroot option so we don't need any docker service to be running.
406
407Installation is actually very straightforward now::
408
409 $ ./run_playbook.sh -i application/hosts.yml -e @application/application_configuration.yml site.yml
410
411This will take a while so be patient.
412
413``'site.yml'`` playbook actually runs in the order the following playbooks:
414
415- ``upload_resources.yml``
416- ``infrastructure.yml``
Bartek Grzybowskicf6797c2019-05-22 14:53:31 +0200417- ``rke.yml``
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100418- ``application.yml``
419
Michal Ptacekc424cff2019-03-06 16:25:43 +0000420----
421
422.. _oooi_installguide_postinstall:
423
Bartek Grzybowski32bf2fb2019-05-30 11:52:40 +0200424Part 4. Post-installation and troubleshooting
425---------------------------------------------
Michal Ptacekc424cff2019-03-06 16:25:43 +0000426
Bartek Grzybowski32bf2fb2019-05-30 11:52:40 +0200427After all of the playbooks are run successfully, it will still take a lot of time until all pods are up and running. You can monitor your newly created kubernetes cluster for example like this::
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100428
429 $ ssh -i ~/.ssh/offline_ssh_key root@10.8.8.4 # tailor this command to connect to your infra-node
430 $ watch -d -n 5 'kubectl get pods --all-namespaces'
431
Bartek Grzybowski32bf2fb2019-05-30 11:52:40 +0200432Alternatively you can monitor progress with ``helm_deployment_status.py`` script located in offline-installer directory. Transfer it to infra-node and run::
Milan Verespej1a230472019-03-20 13:51:40 +0100433
434 $ python helm_deployment_status.py -n <namespace_name> # namespace defaults to onap
435
Bartek Grzybowski32bf2fb2019-05-30 11:52:40 +0200436To automatically verify functionality with healthchecks after deployment becomes ready or after timeout period expires, append ``-hp`` switch followed by the full path to the healthcheck script and ``--health-mode`` optional switch with appropriate mode supported by that script (``health`` by default, ``--help`` displays available modes)::
Milan Verespej1a230472019-03-20 13:51:40 +0100437
Bartek Grzybowski32bf2fb2019-05-30 11:52:40 +0200438 $ python helm_deployment_status.py -hp <app_data_path>/<app_name>/helm_charts/robot/ete-k8s.sh --health-mode <healthcheck mode>
Milan Verespej1a230472019-03-20 13:51:40 +0100439
Bartek Grzybowski32bf2fb2019-05-30 11:52:40 +0200440It is strongly recommended to tailor ``helm_deployment_status.py`` to your needs since default values might not be what you'd expect. The defaults can be displayed with ``--help`` switch.
Michal Ptacekc424cff2019-03-06 16:25:43 +0000441
442Final result of installation varies based on number of k8s nodes used and distribution of pods. In some dev envs we quite frequently hit problems with not all pods properly deployed. In successful deployments all jobs should be in successful state.
443This can be verified using ::
444
445 $ kubectl get jobs -n <namespace>
446
447If some of the job is hanging in some wrong end-state like ``'BackoffLimitExceeded'`` manual intervention is required to heal this and make also dependent jobs passing. More details about particular job state can be obtained using ::
448
449 $ kubectl describe job -n <namespace> <job_name>
450
451If manual intervention is required, one can remove failing job and retry helm install command directly, which will not launch full deployment but rather check current state of the system and rebuild parts which are not up & running. Exact commands are as follows ::
452
453 $ kubectl delete job -n <namespace> <job_name>
454 $ helm deploy <env_name> <helm_chart_name> --namespace <namespace_name>
455
456 E.g. helm deploy dev local/onap --namespace onap
457
458Once all pods are properly deployed and in running state, one can verify functionality e.g. by running onap healthchecks ::
459
460 $ cd <app_data_path>/<app_name>/helm_charts/robot
461 $ ./ete-k8s.sh onap health
462
463
Petr Ospalýbe81ab02019-02-14 21:30:31 +0100464-----
465
466.. _oooi_installguide_appendix1:
467
468Appendix 1. Ansible execution/bootstrap
469---------------------------------------
470
471There are two ways how to easily run the installer's ansible playbooks:
472
473- If you already have or can install a docker then you can build the provided ``'Dockerfile'`` for the ansible and run playbooks in the docker container.
474- Another way to deploy ansible is via chroot environment which is bundled together within this directory.
475
476(Re)build docker image and/or chroot archive
477~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
478
479Inside the ``'docker'`` directory is the ``'Dockerfile'`` and ``'build_ansible_image.sh'`` script. You can run ``'build_ansible_image.sh'`` script on some machine with the internet connectivity and it will download all required packages needed for building the ansible docker image and for exporting it into a flat chroot environment.
480
481Built image is exported into ``'ansible_chroot.tgz'`` archive in the same (``'docker'``) directory.
482
483This script has two optional arguments:
484
485#. ansible version
486#. docker image name
487
488**Note:** if optional arguments are not used, docker image name will be set to ``'ansible'`` by default.
489
490Launching ansible playbook using chroot environment
491~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
492
493This is the default and preferred way of running ansible playbooks in an offline environment as there is no dependency on docker to be installed on the system. Chroot environment is already provided by included archive ``'ansible_chroot.tgz'``.
494
495It should be available in the ``'docker'`` directory as the end-result of the packaging script or after manual run of the ``'build_ansible_image.sh'`` script referenced above.
496
497All playbooks can be executed via ``'./run_playbook.sh'`` wrapper script.
498
499To get more info about the way how the ``'./run_playbook.sh'`` wrapper script should be used, run::
500
501 $ ./run_playbook.sh
502
503The main purpose of this wrapper script is to provide the ansible framework to a machine where it was bootstrapped without need of installing additional packages. The user can run this to display ``'ansible-playbook'`` command help::
504
505 $ ./run_playbook.sh --help
506
507Developers notes
508~~~~~~~~~~~~~~~~
509
510* There are two scripts which work in tandem for creating and running chroot
511* First one can convert docker image into chroot directory
512* Second script will automate chrooting (necessary steps for chroot to work and cleanup)
513* Both of them have help - just run::
514
515 $ cd docker
516 $ ./create_docker_chroot.sh help
517 $ ./run_chroot.sh help
518
519Example usage::
520
521 $ sudo su
522 $ docker/create_docker_chroot.sh convert some_docker_image ./new_name_for_chroot
523 $ cat ./new_name_for_chroot/README.md
524 $ docker/run_chroot.sh execute ./new_name_for_chroot cat /etc/os-release 2>/dev/null
525
526Launching ansible playbook using docker container (ALTERNATIVE APPROACH)
527~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
528
529This option is here just to keep support for the older method which relies on a running docker service. For the offline deployment use the chroot option as indicated above.
530
531You will not need ``'ansible_chroot.tgz'`` archive anymore, but the new requirement is a prebuilt docker image of ansible (based on the provided ``'Dockerfile'``). It should be available in your local docker repository (otherwise the default name ``'ansible'`` may fetch unwanted image from default registry!).
532
533To trigger this functionality and to run ``'ansible-playbook'`` inside a docker container instead of the chroot environment, you must first set the ``ANSIBLE_DOCKER_IMAGE`` variable. The value must be a name of the built ansible docker image.
534
535Usage is basically the same as with the default chroot way - the only difference is the existence of the environment variable::
536
537 $ ANSIBLE_DOCKER_IMAGE=ansible ./run_playbook.sh --help
538
539-----
540
541.. _Build Guide: ./BuildGuide.rst
542.. _Casablanca requirements: https://onap.readthedocs.io/en/casablanca/guides/onap-developer/settingup/index.html#installing-onap
543.. _Casablanca release: https://docs.onap.org/en/casablanca/release/
544.. _OOM ONAP: https://wiki.onap.org/display/DW/ONAP+Operations+Manager+Project