docs: Enclose all snippets in code blocks
[oom.git] / docs / oom_quickstart_guide.rst
1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. Copyright 2019 Amdocs, Bell Canada
5
6 .. _quick-start-label:
7
8 OOM Quick Start Guide
9 #####################
10
11 .. figure:: oomLogoV2-medium.png
12    :align: right
13
14 Once a kubernetes environment is available (follow the instructions in
15 :ref:`cloud-setup-guide-label` if you don't have a cloud environment
16 available), follow the following instructions to deploy ONAP.
17
18 **Step 1.** Clone the OOM repository from ONAP gerrit::
19
20   > git clone -b <BRANCH> http://gerrit.onap.org/r/oom --recurse-submodules
21   > cd oom/kubernetes
22
23 where <BRANCH> can be an offical release tag, such as
24 4.0.0-ONAP for Dublin
25 5.0.1-ONAP for El Alto
26
27 **Step 2.** Install Helm Plugins required to deploy ONAP::
28
29   > sudo cp -R ~/oom/kubernetes/helm/plugins/ ~/.helm
30
31
32 **Step 3.** Customize the helm charts like oom/kubernetes/onap/values.yaml or an override
33 file like onap-all.yaml, onap-vfw.yaml or openstack.yaml file to suit your deployment with items like the
34 OpenStack tenant information.
35
36 .. note::
37   Standard and example override files (e.g. onap-all.yaml, openstack.yaml) can be found in
38   the oom/kubernetes/onap/resources/overrides/ directory.
39
40
41  a. You may want to selectively enable or disable ONAP components by changing
42     the `enabled: true/false` flags.
43
44
45  b. Encyrpt the OpenStack password using the shell tool for robot and put it in
46     the robot helm charts or robot section of openstack.yaml
47
48
49  c. Encrypt the OpenStack password using the java based script for SO helm charts
50     or SO section of openstack.yaml.
51
52
53  d. Update the OpenStack parameters that will be used by robot, SO and APPC helm
54     charts or use an override file to replace them.
55
56
57
58
59 a. Enabling/Disabling Components:
60 Here is an example of the nominal entries that need to be provided.
61 We have different values file available for different contexts.
62
63 .. literalinclude:: ../kubernetes/onap/values.yaml
64    :language: yaml
65
66
67 b. Generating ROBOT Encrypted Password:
68 The ROBOT encrypted Password uses the same encryption.key as SO but an
69 openssl algorithm that works with the python based Robot Framework.
70
71 .. note::
72   To generate ROBOT openStackEncryptedPasswordHere::
73
74     cd so/resources/config/mso/
75     /oom/kubernetes/so/resources/config/mso# echo -n "<openstack tenant password>" | openssl aes-128-ecb -e -K `cat encryption.key` -nosalt | xxd -c 256 -p``
76
77 c. Generating SO Encrypted Password:
78 The SO Encrypted Password uses a java based encryption utility since the
79 Java encryption library is not easy to integrate with openssl/python that
80 ROBOT uses in Dublin.
81
82 .. note::
83   To generate SO openStackEncryptedPasswordHere and openStackSoEncryptedPassword
84   ensure ``default-jdk`` is installed::
85
86     apt-get update; apt-get install default-jdk
87
88   Then execute::
89
90     SO_ENCRYPTION_KEY=`cat ~/oom/kubernetes/so/resources/config/mso/encryption.key`
91     OS_PASSWORD=XXXX_OS_CLEARTESTPASSWORD_XXXX
92
93     git clone http://gerrit.onap.org/r/integration
94     cd integration/deployment/heat/onap-rke/scripts
95
96     javac Crypto.java
97     java Crypto "$OS_PASSWORD" "$SO_ENCRYPTION_KEY"
98
99 d. Update the OpenStack parameters:
100
101 There are assumptions in the demonstration VNF heat templates about the networking 
102 available in the environment. To get the most value out of these templates and the 
103 automation that can help confirm the setup is correct, please observe the following 
104 constraints.
105
106 openStackPublicNetId: 
107
108 This network should allow heat templates to add interfaces. 
109 This need not be an external network, floating IPs can be assigned to the ports on 
110 the VMs that are created by the heat template but its important that neutron allow 
111 ports to be created on them.
112
113 openStackPrivateNetCidr: "10.0.0.0/16"
114
115 This ip address block is used to assign OA&M addresses on VNFs to allow ONAP connectivity.
116 The demonstration heat templates assume that 10.0 prefix can be used by the VNFs and the 
117 demonstration ip addressing plan embodied in the preload template prevent conflicts when 
118 instantiating the various VNFs. If you need to change this, you will need to modify the preload 
119 data in the robot helm chart like integration_preload_parametes.py and the demo/heat/preload_data 
120 in the robot container. The size of the CIDR should be sufficient for ONAP and the VMs you expect 
121 to create.
122
123 openStackOamNetworkCidrPrefix: "10.0"
124
125 This ip prefix mush match the openStackPrivateNetCidr and is a helper variable to some of the
126 robot scripts for demonstration. A production deployment need not worry about this
127 setting but for the demonstration VNFs the ip asssignment strategy assumes 10.0 ip prefix.
128
129
130 Example Keystone v2.0 
131
132 .. literalinclude:: example-integration-override.yaml
133    :language: yaml
134
135 Example Keystone v3  (required for Rocky and later releases)
136
137 .. literalinclude:: example-integration-override-v3.yaml
138    :language: yaml
139
140
141
142 **Step 4.** To setup a local Helm server to server up the ONAP charts::
143
144   > helm serve &
145
146 Note the port number that is listed and use it in the Helm repo add as
147 follows::
148
149   > helm repo add local http://127.0.0.1:8879
150
151 **Step 5.** Verify your Helm repository setup with::
152
153   > helm repo list
154   NAME   URL
155   local  http://127.0.0.1:8879
156
157 **Step 6.** Build a local Helm repository (from the kubernetes directory)::
158
159   > make all; make onap
160
161 **Step 7.** Display the onap charts that available to be deployed::
162
163   > helm search onap -l
164
165 .. literalinclude:: helm-search.txt
166
167 .. note::
168   The setup of the Helm repository is a one time activity. If you make changes to your deployment charts or values be sure to use `make` to update your local Helm repository.
169
170 **Step 8.** Once the repo is setup, installation of ONAP can be done with a
171 single command
172
173 .. note::
174   The --timeout 900 is currently required in Dublin to address long running initialization tasks
175   for DMaaP and SO. Without this timeout value both applications may fail to deploy.
176
177 To deploy all ONAP applications use this command::
178
179     > cd oom/kubernetes
180     > helm deploy dev local/onap --namespace onap -f onap/resources/overrides/onap-all.yaml -f onap/resources/overrides/environment.yaml -f onap/resources/overrides/openstack.yaml --timeout 900
181
182 All override files may be customized (or replaced by other overrides) as per needs.
183
184 onap-all.yaml
185
186   Enables the modules in the ONAP deployment. As ONAP is very modular, it is possible to customize ONAP and disable some components through this configuration file.
187
188 environment.yaml
189
190   Includes configuration values specific to the deployment environment.
191
192   Example: adapt readiness and liveness timers to the level of performance of your infrastructure
193
194 openstack.yaml
195
196   Includes all the Openstack related information for the default target tenant you want to use to deploy VNFs from ONAP and/or additional parameters for the embedded tests.
197
198 **Step 9.** Verify ONAP installation
199
200 Use the following to monitor your deployment and determine when ONAP is ready for use::
201
202   > kubectl get pods -n onap -o=wide
203
204 .. note::
205   While all pods may be in a Running state, it is not a guarantee that all components are running fine.
206
207   Launch the healthcheck tests using Robot to verify that the components are healthy::
208
209     > ~/oom/kubernetes/robot/ete-k8s.sh onap health
210
211 **Step 10.** Undeploy ONAP::
212
213   > helm undeploy dev --purge
214
215 More examples of using the deploy and undeploy plugins can be found here: https://wiki.onap.org/display/DW/OOM+Helm+%28un%29Deploy+plugins