blob: 019d84363f9e8a17436786b07544541b47e4147f [file] [log] [blame]
Eric Debeau993b77b2020-08-19 15:30:00 +02001.. This work is licensed under a Creative Commons Attribution 4.0
2.. International License.
Roger Maitland953b5f12018-03-22 15:24:04 -04003.. http://creativecommons.org/licenses/by/4.0
efiacor370c6dc2021-10-12 14:10:49 +01004.. Copyright 2018-2021 Amdocs, Bell Canada, Orange, Samsung, Nordix Foundation
Jessica Wagantallafb1ead2020-04-09 12:39:10 -07005.. _oom_user_guide:
Roger Maitland953b5f12018-03-22 15:24:04 -04006
7.. Links
8.. _Curated applications for Kubernetes: https://github.com/kubernetes/charts
9.. _Services: https://kubernetes.io/docs/concepts/services-networking/service/
10.. _ReplicaSet: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
11.. _StatefulSet: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
12.. _Helm Documentation: https://docs.helm.sh/helm/
13.. _Helm: https://docs.helm.sh/
14.. _Kubernetes: https://Kubernetes.io/
Eric Debeauc4e405f2020-12-07 14:49:52 +010015.. _Kubernetes LoadBalancer: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
Roger Maitland953b5f12018-03-22 15:24:04 -040016.. _user-guide-label:
17
Bartek Grzybowski305c1be2021-10-26 11:42:08 +020018OOM User Guide
19##############
Roger Maitland953b5f12018-03-22 15:24:04 -040020
21The ONAP Operations Manager (OOM) provide the ability to manage the entire
22life-cycle of an ONAP installation, from the initial deployment to final
23decommissioning. This guide provides instructions for users of ONAP to
24use the Kubernetes_/Helm_ system as a complete ONAP management system.
25
26This guide provides many examples of Helm command line operations. For a
27complete description of these commands please refer to the `Helm
28Documentation`_.
29
30.. figure:: oomLogoV2-medium.png
31 :align: right
32
33The following sections describe the life-cycle operations:
34
35- Deploy_ - with built-in component dependency management
36- Configure_ - unified configuration across all ONAP components
37- Monitor_ - real-time health monitoring feeding to a Consul UI and Kubernetes
38- Heal_- failed ONAP containers are recreated automatically
39- Scale_ - cluster ONAP services to enable seamless scaling
Eric Debeau993b77b2020-08-19 15:30:00 +020040- Upgrade_ - change-out containers or configuration with little or no service
41 impact
Roger Maitland953b5f12018-03-22 15:24:04 -040042- Delete_ - cleanup individual containers or entire deployments
43
44.. figure:: oomLogoV2-Deploy.png
45 :align: right
46
47Deploy
48======
49
50The OOM team with assistance from the ONAP project teams, have built a
51comprehensive set of Helm charts, yaml files very similar to TOSCA files, that
52describe the composition of each of the ONAP components and the relationship
53within and between components. Using this model Helm is able to deploy all of
Roger Maitlandbb8adda2018-04-05 16:18:11 -040054ONAP with a few simple commands.
55
56Pre-requisites
57--------------
Piotr Marcinkiewicz2ca8a472021-04-29 13:29:02 +020058Your environment must have the Kubernetes `kubectl` with Cert-Manager
59and Helm setup as a one time activity.
Roger Maitlandbb8adda2018-04-05 16:18:11 -040060
61Install Kubectl
62~~~~~~~~~~~~~~~
Sylvain Desbureaux983c7552019-01-28 13:59:43 +010063Enter the following to install kubectl (on Ubuntu, there are slight differences
64on other O/Ss), the Kubernetes command line interface used to manage a
65Kubernetes cluster::
Roger Maitlandbb8adda2018-04-05 16:18:11 -040066
Bartek Grzybowski88acd902021-10-26 12:26:58 +020067 > curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.11/bin/linux/amd64/kubectl
Roger Maitlandbb8adda2018-04-05 16:18:11 -040068 > chmod +x ./kubectl
69 > sudo mv ./kubectl /usr/local/bin/kubectl
70 > mkdir ~/.kube
71
Sylvain Desbureaux983c7552019-01-28 13:59:43 +010072Paste kubectl config from Rancher (see the :ref:`cloud-setup-guide-label` for
73alternative Kubernetes environment setups) into the `~/.kube/config` file.
Roger Maitlandbb8adda2018-04-05 16:18:11 -040074
75Verify that the Kubernetes config is correct::
76
77 > kubectl get pods --all-namespaces
78
ramagp060a51c2020-10-29 04:24:16 +000079At this point you should see Kubernetes pods running.
Roger Maitlandbb8adda2018-04-05 16:18:11 -040080
Piotr Marcinkiewicz2ca8a472021-04-29 13:29:02 +020081Install Cert-Manager
82~~~~~~~~~~~~~~~~~~~~
83Details on how to install Cert-Manager can be found
84:doc:`here <oom_setup_paas>`.
85
Roger Maitlandbb8adda2018-04-05 16:18:11 -040086Install Helm
87~~~~~~~~~~~~
Sylvain Desbureaux983c7552019-01-28 13:59:43 +010088Helm is used by OOM for package and configuration management. To install Helm,
89enter the following::
Roger Maitlandbb8adda2018-04-05 16:18:11 -040090
Bartek Grzybowski88acd902021-10-26 12:26:58 +020091 > wget https://get.helm.sh/helm-v3.6.3-linux-amd64.tar.gz
92 > tar -zxvf helm-v3.6.3-linux-amd64.tar.gz
Roger Maitlandbb8adda2018-04-05 16:18:11 -040093 > sudo mv linux-amd64/helm /usr/local/bin/helm
94
95Verify the Helm version with::
96
97 > helm version
98
Roger Maitlandbb8adda2018-04-05 16:18:11 -040099Install the Helm Repo
100---------------------
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100101Once kubectl and Helm are setup, one needs to setup a local Helm server to
102server up the ONAP charts::
Roger Maitland953b5f12018-03-22 15:24:04 -0400103
104 > helm install osn/onap
105
106.. note::
107 The osn repo is not currently available so creation of a local repository is
108 required.
109
110Helm is able to use charts served up from a repository and comes setup with a
111default CNCF provided `Curated applications for Kubernetes`_ repository called
112stable which should be removed to avoid confusion::
113
114 > helm repo remove stable
115
116.. To setup the Open Source Networking Nexus repository for helm enter::
117.. > helm repo add osn 'https://nexus3.onap.org:10001/helm/helm-repo-in-nexus/master/'
118
119To prepare your system for an installation of ONAP, you'll need to::
120
efiacor370c6dc2021-10-12 14:10:49 +0100121 > git clone -b jakarta --recurse-submodules -j2 http://gerrit.onap.org/r/oom
Roger Maitlandbb8adda2018-04-05 16:18:11 -0400122 > cd oom/kubernetes
123
Roger Maitland953b5f12018-03-22 15:24:04 -0400124
Sylvain Desbureaux557628a2021-03-24 14:59:16 +0100125To install a local Helm server::
126
127 > curl -LO https://s3.amazonaws.com/chartmuseum/release/latest/bin/linux/amd64/chartmuseum
128 > chmod +x ./chartmuseum
129 > mv ./chartmuseum /usr/local/bin
130
Roger Maitland953b5f12018-03-22 15:24:04 -0400131To setup a local Helm server to server up the ONAP charts::
132
Sylvain Desbureaux557628a2021-03-24 14:59:16 +0100133 > mkdir -p ~/helm3-storage
134 > chartmuseum --storage local --storage-local-rootdir ~/helm3-storage -port 8879 &
Roger Maitland953b5f12018-03-22 15:24:04 -0400135
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100136Note the port number that is listed and use it in the Helm repo add as
137follows::
Roger Maitland953b5f12018-03-22 15:24:04 -0400138
139 > helm repo add local http://127.0.0.1:8879
140
141To get a list of all of the available Helm chart repositories::
142
143 > helm repo list
144 NAME URL
145 local http://127.0.0.1:8879
146
Roger Maitland9e5067c2018-03-27 10:57:08 -0400147Then build your local Helm repository::
148
Jakub Latusekdb52a6d2020-10-15 15:02:47 +0200149 > make SKIP_LINT=TRUE [HELM_BIN=<HELM_PATH>] all
150
151`HELM_BIN`
Sylvain Desbureaux557628a2021-03-24 14:59:16 +0100152 Sets the helm binary to be used. The default value use helm from PATH
Roger Maitland9e5067c2018-03-27 10:57:08 -0400153
Roger Maitland953b5f12018-03-22 15:24:04 -0400154The Helm search command reads through all of the repositories configured on the
155system, and looks for matches::
156
Sylvain Desbureaux557628a2021-03-24 14:59:16 +0100157 > helm search repo local
Roger Maitland953b5f12018-03-22 15:24:04 -0400158 NAME VERSION DESCRIPTION
efiacor370c6dc2021-10-12 14:10:49 +0100159 local/appc 10.0.0 Application Controller
160 local/clamp 10.0.0 ONAP Clamp
161 local/common 10.0.0 Common templates for inclusion in other charts
162 local/onap 10.0.0 Open Network Automation Platform (ONAP)
163 local/robot 10.0.0 A helm Chart for kubernetes-ONAP Robot
164 local/so 10.0.0 ONAP Service Orchestrator
Roger Maitland953b5f12018-03-22 15:24:04 -0400165
166In any case, setup of the Helm repository is a one time activity.
167
ramagp060a51c2020-10-29 04:24:16 +0000168Next, install Helm Plugins required to deploy the ONAP release::
Pawel Wieczorek1d4b96f2019-01-23 16:46:56 +0100169
Sylvain Desbureaux557628a2021-03-24 14:59:16 +0100170 > cp -R ~/oom/kubernetes/helm/plugins/ ~/.local/share/helm/plugins
Pawel Wieczorek1d4b96f2019-01-23 16:46:56 +0100171
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100172Once the repo is setup, installation of ONAP can be done with a single
173command::
Roger Maitland953b5f12018-03-22 15:24:04 -0400174
ramagp060a51c2020-10-29 04:24:16 +0000175 > helm deploy development local/onap --namespace onap --set global.masterPassword=password
Roger Maitland953b5f12018-03-22 15:24:04 -0400176
177This will install ONAP from a local repository in a 'development' Helm release.
178As described below, to override the default configuration values provided by
179OOM, an environment file can be provided on the command line as follows::
180
ramagp060a51c2020-10-29 04:24:16 +0000181
182
183 > helm deploy development local/onap --namespace onap -f overrides.yaml --set global.masterPassword=password
184
185.. note::
186 Refer the Configure_ section on how to update overrides.yaml and values.yaml
Roger Maitland953b5f12018-03-22 15:24:04 -0400187
188To get a summary of the status of all of the pods (containers) running in your
189deployment::
190
ramagp060a51c2020-10-29 04:24:16 +0000191 > kubectl get pods --namespace onap -o=wide
Roger Maitland953b5f12018-03-22 15:24:04 -0400192
193.. note::
194 The Kubernetes namespace concept allows for multiple instances of a component
195 (such as all of ONAP) to co-exist with other components in the same
196 Kubernetes cluster by isolating them entirely. Namespaces share only the
197 hosts that form the cluster thus providing isolation between production and
ramagp060a51c2020-10-29 04:24:16 +0000198 development systems as an example.
Roger Maitland953b5f12018-03-22 15:24:04 -0400199
200.. note::
Roger Maitlandd96413f2018-04-09 10:06:07 -0400201 The Helm `--name` option refers to a release name and not a Kubernetes namespace.
Roger Maitland953b5f12018-03-22 15:24:04 -0400202
203
204To install a specific version of a single ONAP component (`so` in this example)
Pawel Wieczorek1d4b96f2019-01-23 16:46:56 +0100205with the given release name enter::
Roger Maitland953b5f12018-03-22 15:24:04 -0400206
efiacor370c6dc2021-10-12 14:10:49 +0100207 > helm deploy so onap/so --version 10.0.0 --set global.masterPassword=password --set global.flavor=unlimited --namespace onap
ramagp060a51c2020-10-29 04:24:16 +0000208
209.. note::
210 The dependent components should be installed for component being installed
211
Roger Maitland953b5f12018-03-22 15:24:04 -0400212
213To display details of a specific resource or group of resources type::
214
215 > kubectl describe pod so-1071802958-6twbl
216
217where the pod identifier refers to the auto-generated pod identifier.
218
219.. figure:: oomLogoV2-Configure.png
220 :align: right
221
222Configure
223=========
224
225Each project within ONAP has its own configuration data generally consisting
226of: environment variables, configuration files, and database initial values.
227Many technologies are used across the projects resulting in significant
228operational complexity and an inability to apply global parameters across the
229entire ONAP deployment. OOM solves this problem by introducing a common
230configuration technology, Helm charts, that provide a hierarchical
Gildas Lanilis64d17ae2018-05-18 16:58:05 -0700231configuration with the ability to override values with higher
Roger Maitland953b5f12018-03-22 15:24:04 -0400232level charts or command line options.
233
234The structure of the configuration of ONAP is shown in the following diagram.
235Note that key/value pairs of a parent will always take precedence over those
236of a child. Also note that values set on the command line have the highest
237precedence of all.
238
239.. graphviz::
240
241 digraph config {
242 {
243 node [shape=folder]
244 oValues [label="values.yaml"]
245 demo [label="onap-demo.yaml"]
246 prod [label="onap-production.yaml"]
efiacor370c6dc2021-10-12 14:10:49 +0100247 oReq [label="Chart.yaml"]
Roger Maitland953b5f12018-03-22 15:24:04 -0400248 soValues [label="values.yaml"]
efiacor370c6dc2021-10-12 14:10:49 +0100249 soReq [label="Chart.yaml"]
Roger Maitland953b5f12018-03-22 15:24:04 -0400250 mdValues [label="values.yaml"]
251 }
252 {
253 oResources [label="resources"]
254 }
255 onap -> oResources
256 onap -> oValues
257 oResources -> environments
258 oResources -> oReq
259 oReq -> so
260 environments -> demo
261 environments -> prod
262 so -> soValues
263 so -> soReq
264 so -> charts
265 charts -> mariadb
266 mariadb -> mdValues
267
268 }
269
270The top level onap/values.yaml file contains the values required to be set
271before deploying ONAP. Here is the contents of this file:
272
Pawel Wieczoreka1903d62019-11-14 14:19:59 +0100273.. include:: ../kubernetes/onap/values.yaml
Roger Maitland953b5f12018-03-22 15:24:04 -0400274 :code: yaml
275
276One may wish to create a value file that is specific to a given deployment such
277that it can be differentiated from other deployments. For example, a
278onap-development.yaml file may create a minimal environment for development
279while onap-production.yaml might describe a production deployment that operates
280independently of the developer version.
281
282For example, if the production OpenStack instance was different from a
283developer's instance, the onap-production.yaml file may contain a different
284value for the vnfDeployment/openstack/oam_network_cidr key as shown below.
285
286.. code-block:: yaml
287
288 nsPrefix: onap
289 nodePortPrefix: 302
290 apps: consul msb mso message-router sdnc vid robot portal policy appc aai
291 sdc dcaegen2 log cli multicloud clamp vnfsdk aaf kube2msb
292 dataRootDir: /dockerdata-nfs
293
294 # docker repositories
295 repository:
296 onap: nexus3.onap.org:10001
297 oom: oomk8s
298 aai: aaionap
299 filebeat: docker.elastic.co
300
301 image:
302 pullPolicy: Never
303
304 # vnf deployment environment
305 vnfDeployment:
306 openstack:
307 ubuntu_14_image: "Ubuntu_14.04.5_LTS"
308 public_net_id: "e8f51956-00dd-4425-af36-045716781ffc"
309 oam_network_id: "d4769dfb-c9e4-4f72-b3d6-1d18f4ac4ee6"
310 oam_subnet_id: "191f7580-acf6-4c2b-8ec0-ba7d99b3bc4e"
311 oam_network_cidr: "192.168.30.0/24"
312 <...>
313
314
315To deploy ONAP with this environment file, enter::
316
ramagp060a51c2020-10-29 04:24:16 +0000317 > helm deploy local/onap -n onap -f onap/resources/environments/onap-production.yaml --set global.masterPassword=password
Roger Maitland953b5f12018-03-22 15:24:04 -0400318
319.. include:: environments_onap_demo.yaml
320 :code: yaml
321
efiacor370c6dc2021-10-12 14:10:49 +0100322When deploying all of ONAP, the dependencies section of the Chart.yaml file
323controls which and what version of the ONAP components are included.
324Here is an excerpt of this file:
Roger Maitland953b5f12018-03-22 15:24:04 -0400325
326.. code-block:: yaml
327
Roger Maitland953b5f12018-03-22 15:24:04 -0400328 dependencies:
329 <...>
330 - name: so
efiacor370c6dc2021-10-12 14:10:49 +0100331 version: ~10.0.0
Roger Maitland953b5f12018-03-22 15:24:04 -0400332 repository: '@local'
333 condition: so.enabled
334 <...>
335
efiacor370c6dc2021-10-12 14:10:49 +0100336The ~ operator in the `so` version value indicates that the latest "10.X.X"
Roger Maitland953b5f12018-03-22 15:24:04 -0400337version of `so` shall be used thus allowing the chart to allow for minor
efiacor370c6dc2021-10-12 14:10:49 +0100338upgrades that don't impact the so API; hence, version 10.0.1 will be installed
Roger Maitland953b5f12018-03-22 15:24:04 -0400339in this case.
340
ramagp060a51c2020-10-29 04:24:16 +0000341The onap/resources/environment/dev.yaml (see the excerpt below) enables
Roger Maitland953b5f12018-03-22 15:24:04 -0400342for fine grained control on what components are included as part of this
343deployment. By changing this `so` line to `enabled: false` the `so` component
344will not be deployed. If this change is part of an upgrade the existing `so`
345component will be shut down. Other `so` parameters and even `so` child values
346can be modified, for example the `so`'s `liveness` probe could be disabled
347(which is not recommended as this change would disable auto-healing of `so`).
348
349.. code-block:: yaml
350
351 #################################################################
352 # Global configuration overrides.
353 #
354 # These overrides will affect all helm charts (ie. applications)
355 # that are listed below and are 'enabled'.
356 #################################################################
357 global:
358 <...>
359
360 #################################################################
361 # Enable/disable and configure helm charts (ie. applications)
362 # to customize the ONAP deployment.
363 #################################################################
364 aaf:
365 enabled: false
366 <...>
367 so: # Service Orchestrator
368 enabled: true
369
370 replicaCount: 1
371
372 liveness:
373 # necessary to disable liveness probe when setting breakpoints
374 # in debugger so K8s doesn't restart unresponsive container
375 enabled: true
376
377 <...>
378
Roger Maitlandda221582018-05-10 13:43:58 -0400379Accessing the ONAP Portal using OOM and a Kubernetes Cluster
380------------------------------------------------------------
381
382The ONAP deployment created by OOM operates in a private IP network that isn't
Eric Debeau993b77b2020-08-19 15:30:00 +0200383publicly accessible (i.e. OpenStack VMs with private internal network) which
Roger Maitlandda221582018-05-10 13:43:58 -0400384blocks access to the ONAP Portal. To enable direct access to this Portal from a
385user's own environment (a laptop etc.) the portal application's port 8989 is
386exposed through a `Kubernetes LoadBalancer`_ object.
387
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100388Typically, to be able to access the Kubernetes nodes publicly a public address
Eric Debeau993b77b2020-08-19 15:30:00 +0200389is assigned. In OpenStack this is a floating IP address.
Roger Maitlandda221582018-05-10 13:43:58 -0400390
391When the `portal-app` chart is deployed a Kubernetes service is created that
392instantiates a load balancer. The LB chooses the private interface of one of
393the nodes as in the example below (10.0.0.4 is private to the K8s cluster only).
394Then to be able to access the portal on port 8989 from outside the K8s &
Eric Debeau993b77b2020-08-19 15:30:00 +0200395OpenStack environment, the user needs to assign/get the floating IP address that
Roger Maitlandda221582018-05-10 13:43:58 -0400396corresponds to the private IP as follows::
397
398 > kubectl -n onap get services|grep "portal-app"
399 portal-app LoadBalancer 10.43.142.201 10.0.0.4 8989:30215/TCP,8006:30213/TCP,8010:30214/TCP 1d app=portal-app,release=dev
400
401
402In this example, use the 10.0.0.4 private address as a key find the
403corresponding public address which in this example is 10.12.6.155. If you're
Eric Debeau993b77b2020-08-19 15:30:00 +0200404using OpenStack you'll do the lookup with the horizon GUI or the OpenStack CLI
Roger Maitlandda221582018-05-10 13:43:58 -0400405for your tenant (openstack server list). That IP is then used in your
406`/etc/hosts` to map the fixed DNS aliases required by the ONAP Portal as shown
407below::
408
409 10.12.6.155 portal.api.simpledemo.onap.org
410 10.12.6.155 vid.api.simpledemo.onap.org
411 10.12.6.155 sdc.api.fe.simpledemo.onap.org
andreasgeissler4a618ba2018-11-30 14:20:46 +0000412 10.12.6.155 sdc.workflow.plugin.simpledemo.onap.org
413 10.12.6.155 sdc.dcae.plugin.simpledemo.onap.org
Roger Maitlandda221582018-05-10 13:43:58 -0400414 10.12.6.155 portal-sdk.simpledemo.onap.org
415 10.12.6.155 policy.api.simpledemo.onap.org
416 10.12.6.155 aai.api.sparky.simpledemo.onap.org
417 10.12.6.155 cli.api.simpledemo.onap.org
418 10.12.6.155 msb.api.discovery.simpledemo.onap.org
andreasgeissler4a618ba2018-11-30 14:20:46 +0000419 10.12.6.155 msb.api.simpledemo.onap.org
420 10.12.6.155 clamp.api.simpledemo.onap.org
421 10.12.6.155 so.api.simpledemo.onap.org
Sylvain Desbureaux1037d752020-04-20 14:17:16 +0200422 10.12.6.155 sdc.workflow.plugin.simpledemo.onap.org
Roger Maitlandda221582018-05-10 13:43:58 -0400423
424Ensure you've disabled any proxy settings the browser you are using to access
andreasgeissler4a618ba2018-11-30 14:20:46 +0000425the portal and then simply access now the new ssl-encrypted URL:
Eric Debeauc4e405f2020-12-07 14:49:52 +0100426``https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm``
Roger Maitlandda221582018-05-10 13:43:58 -0400427
andreasgeissler4a618ba2018-11-30 14:20:46 +0000428.. note::
429 Using the HTTPS based Portal URL the Browser needs to be configured to accept
430 unsecure credentials.
431 Additionally when opening an Application inside the Portal, the Browser
432 might block the content, which requires to disable the blocking and reloading
433 of the page
434
435.. note::
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100436 Besides the ONAP Portal the Components can deliver additional user interfaces,
andreasgeissler4a618ba2018-11-30 14:20:46 +0000437 please check the Component specific documentation.
Roger Maitlandda221582018-05-10 13:43:58 -0400438
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100439.. note::
Roger Maitlandda221582018-05-10 13:43:58 -0400440
Hector Anapan-Lavalle55547da2018-07-26 13:33:17 -0400441 | Alternatives Considered:
442
guillaume.lambertf3319a82021-09-26 21:37:50 +0200443 - Kubernetes port forwarding was considered but discarded as it would
444 require the end user to run a script that opens up port forwarding tunnels
445 to each of the pods that provides a portal application widget.
Hector Anapan-Lavalle55547da2018-07-26 13:33:17 -0400446
447 - Reverting to a VNC server similar to what was deployed in the Amsterdam
guillaume.lambertf3319a82021-09-26 21:37:50 +0200448 release was also considered but there were many issues with resolution,
449 lack of volume mount, /etc/hosts dynamic update, file upload that were
450 a tall order to solve in time for the Beijing release.
Hector Anapan-Lavalle55547da2018-07-26 13:33:17 -0400451
452 Observations:
453
guillaume.lambertf3319a82021-09-26 21:37:50 +0200454 - If you are not using floating IPs in your Kubernetes deployment and
455 directly attaching a public IP address (i.e. by using your public provider
456 network) to your K8S Node VMs' network interface, then the output of
457 'kubectl -n onap get services | grep "portal-app"'
Hector Anapan-Lavalle55547da2018-07-26 13:33:17 -0400458 will show your public IP instead of the private network's IP. Therefore,
guillaume.lambertf3319a82021-09-26 21:37:50 +0200459 you can grab this public IP directly (as compared to trying to find the
460 floating IP first) and map this IP in /etc/hosts.
Roger Maitlandda221582018-05-10 13:43:58 -0400461
Roger Maitland953b5f12018-03-22 15:24:04 -0400462.. figure:: oomLogoV2-Monitor.png
463 :align: right
464
465Monitor
466=======
467
468All highly available systems include at least one facility to monitor the
469health of components within the system. Such health monitors are often used as
Eric Debeau993b77b2020-08-19 15:30:00 +0200470inputs to distributed coordination systems (such as etcd, Zookeeper, or Consul)
471and monitoring systems (such as Nagios or Zabbix). OOM provides two mechanisms
Roger Maitland953b5f12018-03-22 15:24:04 -0400472to monitor the real-time health of an ONAP deployment:
473
474- a Consul GUI for a human operator or downstream monitoring systems and
475 Kubernetes liveness probes that enable automatic healing of failed
476 containers, and
477- a set of liveness probes which feed into the Kubernetes manager which
478 are described in the Heal section.
479
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100480Within ONAP, Consul is the monitoring system of choice and deployed by OOM in
481two parts:
Roger Maitland953b5f12018-03-22 15:24:04 -0400482
483- a three-way, centralized Consul server cluster is deployed as a highly
Gildas Lanilis64d17ae2018-05-18 16:58:05 -0700484 available monitor of all of the ONAP components, and
Roger Maitland953b5f12018-03-22 15:24:04 -0400485- a number of Consul agents.
486
487The Consul server provides a user interface that allows a user to graphically
488view the current health status of all of the ONAP components for which agents
489have been created - a sample from the ONAP Integration labs follows:
490
491.. figure:: consulHealth.png
492 :align: center
493
Eric Debeauc4e405f2020-12-07 14:49:52 +0100494To see the real-time health of a deployment go to: ``http://<kubernetes IP>:30270/ui/``
Roger Maitland953b5f12018-03-22 15:24:04 -0400495where a GUI much like the following will be found:
496
ramagp060a51c2020-10-29 04:24:16 +0000497.. note::
498 If Consul GUI is not accessible, you can refer this
499 `kubectl port-forward <https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/>`_ method to access an application
Roger Maitland953b5f12018-03-22 15:24:04 -0400500
501.. figure:: oomLogoV2-Heal.png
502 :align: right
503
504Heal
505====
506
507The ONAP deployment is defined by Helm charts as mentioned earlier. These Helm
508charts are also used to implement automatic recoverability of ONAP components
509when individual components fail. Once ONAP is deployed, a "liveness" probe
510starts checking the health of the components after a specified startup time.
511
512Should a liveness probe indicate a failed container it will be terminated and a
513replacement will be started in its place - containers are ephemeral. Should the
514deployment specification indicate that there are one or more dependencies to
515this container or component (for example a dependency on a database) the
516dependency will be satisfied before the replacement container/component is
517started. This mechanism ensures that, after a failure, all of the ONAP
518components restart successfully.
519
520To test healing, the following command can be used to delete a pod::
521
522 > kubectl delete pod [pod name] -n [pod namespace]
523
524One could then use the following command to monitor the pods and observe the
525pod being terminated and the service being automatically healed with the
526creation of a replacement pod::
527
528 > kubectl get pods --all-namespaces -o=wide
529
530.. figure:: oomLogoV2-Scale.png
531 :align: right
532
533Scale
534=====
535
536Many of the ONAP components are horizontally scalable which allows them to
537adapt to expected offered load. During the Beijing release scaling is static,
538that is during deployment or upgrade a cluster size is defined and this cluster
539will be maintained even in the presence of faults. The parameter that controls
540the cluster size of a given component is found in the values.yaml file for that
541component. Here is an excerpt that shows this parameter:
542
543.. code-block:: yaml
544
545 # default number of instances
546 replicaCount: 1
547
548In order to change the size of a cluster, an operator could use a helm upgrade
549(described in detail in the next section) as follows::
550
ramagp060a51c2020-10-29 04:24:16 +0000551 > helm upgrade [RELEASE] [CHART] [flags]
552
553The RELEASE argument can be obtained from the following command::
554
555 > helm list
556
557Below is the example for the same::
558
559 > helm list
560 NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
efiacor370c6dc2021-10-12 14:10:49 +0100561 dev 1 Wed Oct 14 13:49:52 2020 DEPLOYED onap-10.0.0 Jakarta onap
562 dev-cassandra 5 Thu Oct 15 14:45:34 2020 DEPLOYED cassandra-10.0.0 onap
563 dev-contrib 1 Wed Oct 14 13:52:53 2020 DEPLOYED contrib-10.0.0 onap
564 dev-mariadb-galera 1 Wed Oct 14 13:55:56 2020 DEPLOYED mariadb-galera-10.0.0 onap
ramagp060a51c2020-10-29 04:24:16 +0000565
566Here the Name column shows the RELEASE NAME, In our case we want to try the
567scale operation on cassandra, thus the RELEASE NAME would be dev-cassandra.
568
guillaume.lambertb90e8fc2021-09-26 21:28:50 +0200569Now we need to obtain the chart name for cassandra. Use the below
ramagp060a51c2020-10-29 04:24:16 +0000570command to get the chart name::
571
572 > helm search cassandra
573
574Below is the example for the same::
575
576 > helm search cassandra
577 NAME CHART VERSION APP VERSION DESCRIPTION
efiacor370c6dc2021-10-12 14:10:49 +0100578 local/cassandra 10.0.0 ONAP cassandra
579 local/portal-cassandra 10.0.0 Portal cassandra
580 local/aaf-cass 10.0.0 ONAP AAF cassandra
581 local/sdc-cs 10.0.0 ONAP Service Design and Creation Cassandra
ramagp060a51c2020-10-29 04:24:16 +0000582
583Here the Name column shows the chart name. As we want to try the scale
guillaume.lambertb90e8fc2021-09-26 21:28:50 +0200584operation for cassandra, thus the corresponding chart name is local/cassandra
ramagp060a51c2020-10-29 04:24:16 +0000585
586
587Now we have both the command's arguments, thus we can perform the
guillaume.lambertb90e8fc2021-09-26 21:28:50 +0200588scale operation for cassandra as follows::
ramagp060a51c2020-10-29 04:24:16 +0000589
590 > helm upgrade dev-cassandra local/cassandra --set replicaCount=3
591
guillaume.lambertb90e8fc2021-09-26 21:28:50 +0200592Using this command we can scale up or scale down the cassandra db instances.
ramagp060a51c2020-10-29 04:24:16 +0000593
Roger Maitland953b5f12018-03-22 15:24:04 -0400594
595The ONAP components use Kubernetes provided facilities to build clustered,
596highly available systems including: Services_ with load-balancers, ReplicaSet_,
597and StatefulSet_. Some of the open-source projects used by the ONAP components
598directly support clustered configurations, for example ODL and MariaDB Galera.
599
600The Kubernetes Services_ abstraction to provide a consistent access point for
601each of the ONAP components, independent of the pod or container architecture
602of that component. For example, SDN-C uses OpenDaylight clustering with a
603default cluster size of three but uses a Kubernetes service to and change the
604number of pods in this abstract this cluster from the other ONAP components
605such that the cluster could change size and this change is isolated from the
606other ONAP components by the load-balancer implemented in the ODL service
607abstraction.
608
609A ReplicaSet_ is a construct that is used to describe the desired state of the
610cluster. For example 'replicas: 3' indicates to Kubernetes that a cluster of 3
611instances is the desired state. Should one of the members of the cluster fail,
612a new member will be automatically started to replace it.
613
614Some of the ONAP components many need a more deterministic deployment; for
615example to enable intra-cluster communication. For these applications the
616component can be deployed as a Kubernetes StatefulSet_ which will maintain a
617persistent identifier for the pods and thus a stable network id for the pods.
618For example: the pod names might be web-0, web-1, web-{N-1} for N 'web' pods
619with corresponding DNS entries such that intra service communication is simple
620even if the pods are physically distributed across multiple nodes. An example
621of how these capabilities can be used is described in the Running Consul on
622Kubernetes tutorial.
623
624.. figure:: oomLogoV2-Upgrade.png
625 :align: right
626
627Upgrade
628=======
629
630Helm has built-in capabilities to enable the upgrade of pods without causing a
631loss of the service being provided by that pod or pods (if configured as a
632cluster). As described in the OOM Developer's Guide, ONAP components provide
633an abstracted 'service' end point with the pods or containers providing this
634service hidden from other ONAP components by a load balancer. This capability
635is used during upgrades to allow a pod with a new image to be added to the
636service before removing the pod with the old image. This 'make before break'
637capability ensures minimal downtime.
638
639Prior to doing an upgrade, determine of the status of the deployed charts::
640
641 > helm list
642 NAME REVISION UPDATED STATUS CHART NAMESPACE
efiacor370c6dc2021-10-12 14:10:49 +0100643 so 1 Mon Feb 5 10:05:22 2020 DEPLOYED so-10.0.0 onap
Roger Maitland953b5f12018-03-22 15:24:04 -0400644
645When upgrading a cluster a parameter controls the minimum size of the cluster
646during the upgrade while another parameter controls the maximum number of nodes
647in the cluster. For example, SNDC configured as a 3-way ODL cluster might
648require that during the upgrade no fewer than 2 pods are available at all times
649to provide service while no more than 5 pods are ever deployed across the two
650versions at any one time to avoid depleting the cluster of resources. In this
651scenario, the SDNC cluster would start with 3 old pods then Kubernetes may add
652a new pod (3 old, 1 new), delete one old (2 old, 1 new), add two new pods (2
653old, 3 new) and finally delete the 2 old pods (3 new). During this sequence
654the constraints of the minimum of two pods and maximum of five would be
655maintained while providing service the whole time.
656
657Initiation of an upgrade is triggered by changes in the Helm charts. For
658example, if the image specified for one of the pods in the SDNC deployment
659specification were to change (i.e. point to a new Docker image in the nexus3
660repository - commonly through the change of a deployment variable), the
661sequence of events described in the previous paragraph would be initiated.
662
663For example, to upgrade a container by changing configuration, specifically an
664environment value::
665
ramagp060a51c2020-10-29 04:24:16 +0000666 > helm upgrade so onap/so --version 8.0.1 --set enableDebug=true
Roger Maitland953b5f12018-03-22 15:24:04 -0400667
668Issuing this command will result in the appropriate container being stopped by
669Kubernetes and replaced with a new container with the new environment value.
670
671To upgrade a component to a new version with a new configuration file enter::
672
ramagp060a51c2020-10-29 04:24:16 +0000673 > helm upgrade so onap/so --version 8.0.1 -f environments/demo.yaml
Roger Maitland953b5f12018-03-22 15:24:04 -0400674
675To fetch release history enter::
676
677 > helm history so
678 REVISION UPDATED STATUS CHART DESCRIPTION
efiacor370c6dc2021-10-12 14:10:49 +0100679 1 Mon Feb 5 10:05:22 2020 SUPERSEDED so-9.0.0 Install complete
680 2 Mon Feb 5 10:10:55 2020 DEPLOYED so-10.0.0 Upgrade complete
Roger Maitland953b5f12018-03-22 15:24:04 -0400681
682Unfortunately, not all upgrades are successful. In recognition of this the
683lineup of pods within an ONAP deployment is tagged such that an administrator
684may force the ONAP deployment back to the previously tagged configuration or to
685a specific configuration, say to jump back two steps if an incompatibility
686between two ONAP components is discovered after the two individual upgrades
687succeeded.
688
689This rollback functionality gives the administrator confidence that in the
690unfortunate circumstance of a failed upgrade the system can be rapidly brought
691back to a known good state. This process of rolling upgrades while under
692service is illustrated in this short YouTube video showing a Zero Downtime
693Upgrade of a web application while under a 10 million transaction per second
694load.
695
696For example, to roll-back back to previous system revision enter::
697
698 > helm rollback so 1
699
700 > helm history so
701 REVISION UPDATED STATUS CHART DESCRIPTION
efiacor370c6dc2021-10-12 14:10:49 +0100702 1 Mon Feb 5 10:05:22 2020 SUPERSEDED so-9.0.0 Install complete
703 2 Mon Feb 5 10:10:55 2020 SUPERSEDED so-10.0.0 Upgrade complete
704 3 Mon Feb 5 10:14:32 2020 DEPLOYED so-9.0.0 Rollback to 1
Roger Maitland953b5f12018-03-22 15:24:04 -0400705
706.. note::
707
708 The description field can be overridden to document actions taken or include
709 tracking numbers.
710
711Many of the ONAP components contain their own databases which are used to
712record configuration or state information. The schemas of these databases may
713change from version to version in such a way that data stored within the
714database needs to be migrated between versions. If such a migration script is
715available it can be invoked during the upgrade (or rollback) by Container
716Lifecycle Hooks. Two such hooks are available, PostStart and PreStop, which
717containers can access by registering a handler against one or both. Note that
718it is the responsibility of the ONAP component owners to implement the hook
719handlers - which could be a shell script or a call to a specific container HTTP
720endpoint - following the guidelines listed on the Kubernetes site. Lifecycle
721hooks are not restricted to database migration or even upgrades but can be used
722anywhere specific operations need to be taken during lifecycle operations.
723
724OOM uses Helm K8S package manager to deploy ONAP components. Each component is
725arranged in a packaging format called a chart - a collection of files that
726describe a set of k8s resources. Helm allows for rolling upgrades of the ONAP
727component deployed. To upgrade a component Helm release you will need an
728updated Helm chart. The chart might have modified, deleted or added values,
729deployment yamls, and more. To get the release name use::
730
731 > helm ls
732
733To easily upgrade the release use::
734
735 > helm upgrade [RELEASE] [CHART]
736
737To roll back to a previous release version use::
738
739 > helm rollback [flags] [RELEASE] [REVISION]
740
741For example, to upgrade the onap-so helm release to the latest SO container
742release v1.1.2:
743
744- Edit so values.yaml which is part of the chart
745- Change "so: nexus3.onap.org:10001/openecomp/so:v1.1.1" to
746 "so: nexus3.onap.org:10001/openecomp/so:v1.1.2"
747- From the chart location run::
748
749 > helm upgrade onap-so
750
751The previous so pod will be terminated and a new so pod with an updated so
752container will be created.
753
754.. figure:: oomLogoV2-Delete.png
755 :align: right
756
757Delete
758======
759
760Existing deployments can be partially or fully removed once they are no longer
761needed. To minimize errors it is recommended that before deleting components
762from a running deployment the operator perform a 'dry-run' to display exactly
ramagp060a51c2020-10-29 04:24:16 +0000763what will happen with a given command prior to actually deleting anything.
764For example::
Roger Maitland953b5f12018-03-22 15:24:04 -0400765
Sylvain Desbureaux5e19e242020-03-02 14:41:48 +0100766 > helm undeploy onap --dry-run
Roger Maitland953b5f12018-03-22 15:24:04 -0400767
Sylvain Desbureaux5e19e242020-03-02 14:41:48 +0100768will display the outcome of deleting the 'onap' release from the
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100769deployment.
Roger Maitland953b5f12018-03-22 15:24:04 -0400770To completely delete a release and remove it from the internal store enter::
771
Sylvain Desbureaux557628a2021-03-24 14:59:16 +0100772 > helm undeploy onap
Roger Maitland953b5f12018-03-22 15:24:04 -0400773
ramagp060a51c2020-10-29 04:24:16 +0000774Once complete undeploy is done then delete the namespace as well
775using following command::
776
777 > kubectl delete namespace <name of namespace>
778
779.. note::
780 You need to provide the namespace name which you used during deployment,
781 below is the example::
782
783 > kubectl delete namespace onap
784
Roger Maitland953b5f12018-03-22 15:24:04 -0400785One can also remove individual components from a deployment by changing the
786ONAP configuration values. For example, to remove `so` from a running
787deployment enter::
788
Sylvain Desbureaux557628a2021-03-24 14:59:16 +0100789 > helm undeploy onap-so
Roger Maitland953b5f12018-03-22 15:24:04 -0400790
791will remove `so` as the configuration indicates it's no longer part of the
792deployment. This might be useful if a one wanted to replace just `so` by
Sylvain Desbureaux983c7552019-01-28 13:59:43 +0100793installing a custom version.