blob: 08e9ec0d0ba4975b365d98b75994d0c48c3c158c [file] [log] [blame]
Jakub Latusek222b48b2020-10-16 14:44:38 +02001.. This work is licensed under a Creative Commons Attribution 4.0
2.. International License.
3.. http://creativecommons.org/licenses/by/4.0
4.. Copyright 2018-2020 Amdocs, Bell Canada, Orange, Samsung
5.. _oom_user_guide:
6
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/
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010015.. _Kubernetes LoadBalancer: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
16.. _oom_user_guide_helm3:
Jakub Latusek222b48b2020-10-16 14:44:38 +020017
18OOM User Guide helm3 (experimental)
19###################################
20
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
40- Upgrade_ - change-out containers or configuration with little or no service
41 impact
42- 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
54ONAP with a few simple commands.
55
56Pre-requisites
57--------------
58Your environment must have both the Kubernetes `kubectl` and Helm setup as a
59one time activity.
60
61Install Kubectl
62~~~~~~~~~~~~~~~
63Enter 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::
66
67 > curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.10/bin/linux/amd64/kubectl
68 > chmod +x ./kubectl
69 > sudo mv ./kubectl /usr/local/bin/kubectl
70 > mkdir ~/.kube
71
72Paste kubectl config from Rancher (see the :ref:`cloud-setup-guide-label` for
73alternative Kubernetes environment setups) into the `~/.kube/config` file.
74
75Verify that the Kubernetes config is correct::
76
77 > kubectl get pods --all-namespaces
78
79At this point you should see six Kubernetes pods running.
80
81Install Helm
82~~~~~~~~~~~~
83Helm is used by OOM for package and configuration management. To install Helm,
84enter the following::
85
86 > wget https://get.helm.sh/helm-v3.3.4-linux-amd64.tar.gz
87 > tar -zxvf helm-v3.3.4-linux-amd64.tar.gz
88 > sudo mv linux-amd64/helm /usr/local/bin/helm
89
90Verify the Helm version with::
91
92 > helm version
93
94Install the Helm Repo
95---------------------
96Once kubectl and Helm are setup, one needs to setup a local Helm server to
97server up the ONAP charts::
98
99 > helm install osn/onap
100
101.. note::
102 The osn repo is not currently available so creation of a local repository is
103 required.
104
105Helm is able to use charts served up from a repository and comes setup with a
106default CNCF provided `Curated applications for Kubernetes`_ repository called
107stable which should be removed to avoid confusion::
108
109 > helm repo remove stable
110
111.. To setup the Open Source Networking Nexus repository for helm enter::
112.. > helm repo add osn 'https://nexus3.onap.org:10001/helm/helm-repo-in-nexus/master/'
113
114To prepare your system for an installation of ONAP, you'll need to::
115
116 > git clone -b guilin --recurse-submodules -j2 http://gerrit.onap.org/r/oom
117 > cd oom/kubernetes
118
119
120To install a local Helm server::
121
122 > curl -LO https://s3.amazonaws.com/chartmuseum/release/latest/bin/linux/amd64/chartmuseum
123 > chmod +x ./chartmuseum
124 > mv ./chartmuseum /usr/local/bin
125
126To setup a local Helm server to server up the ONAP charts::
127
128 > mkdir -p ~/helm3-storage
129 > chartmuseum --storage local --storage-local-rootdir ~/helm3-storage -port 8879 &
130
131Note the port number that is listed and use it in the Helm repo add as
132follows::
133
134 > helm repo add local http://127.0.0.1:8879
135
136To get a list of all of the available Helm chart repositories::
137
138 > helm repo list
139 NAME URL
140 local http://127.0.0.1:8879
141
142Then build your local Helm repository::
143
144 > make SKIP_LINT=TRUE [HELM_BIN=<HELM_PATH>] all
145
146`HELM_BIN`
147 Sets the helm binary to be used. The default value use helm from PATH
148
149The Helm search command reads through all of the repositories configured on the
150system, and looks for matches::
151
152 > helm search -l
153 NAME VERSION DESCRIPTION
154 local/appc 2.0.0 Application Controller
155 local/clamp 2.0.0 ONAP Clamp
156 local/common 2.0.0 Common templates for inclusion in other charts
157 local/onap 2.0.0 Open Network Automation Platform (ONAP)
158 local/robot 2.0.0 A helm Chart for kubernetes-ONAP Robot
159 local/so 2.0.0 ONAP Service Orchestrator
160
161In any case, setup of the Helm repository is a one time activity.
162
163Next, install Helm Plugins required to deploy the ONAP Casablanca release::
164
165 > cp -R ~/oom/kubernetes/helm/plugins/ ~/.local/share/helm/plugins
166
167Once the repo is setup, installation of ONAP can be done with a single
168command::
169
170 > helm deploy development local/onap --namespace onap
171
172This will install ONAP from a local repository in a 'development' Helm release.
173As described below, to override the default configuration values provided by
174OOM, an environment file can be provided on the command line as follows::
175
176 > helm deploy development local/onap --namespace onap -f overrides.yaml
177
178To get a summary of the status of all of the pods (containers) running in your
179deployment::
180
181 > kubectl get pods --all-namespaces -o=wide
182
183.. note::
184 The Kubernetes namespace concept allows for multiple instances of a component
185 (such as all of ONAP) to co-exist with other components in the same
186 Kubernetes cluster by isolating them entirely. Namespaces share only the
187 hosts that form the cluster thus providing isolation between production and
188 development systems as an example. The OOM deployment of ONAP in Beijing is
189 now done within a single Kubernetes namespace where in Amsterdam a namespace
190 was created for each of the ONAP components.
191
192.. note::
193 The Helm `--name` option refers to a release name and not a Kubernetes namespace.
194
195
196To install a specific version of a single ONAP component (`so` in this example)
197with the given release name enter::
198
199 > helm deploy so onap/so --version 3.0.1
200
201To display details of a specific resource or group of resources type::
202
203 > kubectl describe pod so-1071802958-6twbl
204
205where the pod identifier refers to the auto-generated pod identifier.
206
207.. figure:: oomLogoV2-Configure.png
208 :align: right
209
210Configure
211=========
212
213Each project within ONAP has its own configuration data generally consisting
214of: environment variables, configuration files, and database initial values.
215Many technologies are used across the projects resulting in significant
216operational complexity and an inability to apply global parameters across the
217entire ONAP deployment. OOM solves this problem by introducing a common
218configuration technology, Helm charts, that provide a hierarchical
219configuration with the ability to override values with higher
220level charts or command line options.
221
222The structure of the configuration of ONAP is shown in the following diagram.
223Note that key/value pairs of a parent will always take precedence over those
224of a child. Also note that values set on the command line have the highest
225precedence of all.
226
227.. graphviz::
228
229 digraph config {
230 {
231 node [shape=folder]
232 oValues [label="values.yaml"]
233 demo [label="onap-demo.yaml"]
234 prod [label="onap-production.yaml"]
235 oReq [label="requirements.yaml"]
236 soValues [label="values.yaml"]
237 soReq [label="requirements.yaml"]
238 mdValues [label="values.yaml"]
239 }
240 {
241 oResources [label="resources"]
242 }
243 onap -> oResources
244 onap -> oValues
245 oResources -> environments
246 oResources -> oReq
247 oReq -> so
248 environments -> demo
249 environments -> prod
250 so -> soValues
251 so -> soReq
252 so -> charts
253 charts -> mariadb
254 mariadb -> mdValues
255
256 }
257
258The top level onap/values.yaml file contains the values required to be set
259before deploying ONAP. Here is the contents of this file:
260
261.. include:: ../kubernetes/onap/values.yaml
262 :code: yaml
263
264One may wish to create a value file that is specific to a given deployment such
265that it can be differentiated from other deployments. For example, a
266onap-development.yaml file may create a minimal environment for development
267while onap-production.yaml might describe a production deployment that operates
268independently of the developer version.
269
270For example, if the production OpenStack instance was different from a
271developer's instance, the onap-production.yaml file may contain a different
272value for the vnfDeployment/openstack/oam_network_cidr key as shown below.
273
274.. code-block:: yaml
275
276 nsPrefix: onap
277 nodePortPrefix: 302
278 apps: consul msb mso message-router sdnc vid robot portal policy appc aai
279 sdc dcaegen2 log cli multicloud clamp vnfsdk aaf kube2msb
280 dataRootDir: /dockerdata-nfs
281
282 # docker repositories
283 repository:
284 onap: nexus3.onap.org:10001
285 oom: oomk8s
286 aai: aaionap
287 filebeat: docker.elastic.co
288
289 image:
290 pullPolicy: Never
291
292 # vnf deployment environment
293 vnfDeployment:
294 openstack:
295 ubuntu_14_image: "Ubuntu_14.04.5_LTS"
296 public_net_id: "e8f51956-00dd-4425-af36-045716781ffc"
297 oam_network_id: "d4769dfb-c9e4-4f72-b3d6-1d18f4ac4ee6"
298 oam_subnet_id: "191f7580-acf6-4c2b-8ec0-ba7d99b3bc4e"
299 oam_network_cidr: "192.168.30.0/24"
300 <...>
301
302
303To deploy ONAP with this environment file, enter::
304
305 > helm deploy local/onap -n onap -f environments/onap-production.yaml
306
307.. include:: environments_onap_demo.yaml
308 :code: yaml
309
310When deploying all of ONAP a requirements.yaml file control which and what
311version of the ONAP components are included. Here is an excerpt of this
312file:
313
314.. code-block:: yaml
315
316 # Referencing a named repo called 'local'.
317 # Can add this repo by running commands like:
318 # > helm serve
319 # > helm repo add local http://127.0.0.1:8879
320 dependencies:
321 <...>
322 - name: so
323 version: ~2.0.0
324 repository: '@local'
325 condition: so.enabled
326 <...>
327
328The ~ operator in the `so` version value indicates that the latest "2.X.X"
329version of `so` shall be used thus allowing the chart to allow for minor
330upgrades that don't impact the so API; hence, version 2.0.1 will be installed
331in this case.
332
333The onap/resources/environment/onap-dev.yaml (see the excerpt below) enables
334for fine grained control on what components are included as part of this
335deployment. By changing this `so` line to `enabled: false` the `so` component
336will not be deployed. If this change is part of an upgrade the existing `so`
337component will be shut down. Other `so` parameters and even `so` child values
338can be modified, for example the `so`'s `liveness` probe could be disabled
339(which is not recommended as this change would disable auto-healing of `so`).
340
341.. code-block:: yaml
342
343 #################################################################
344 # Global configuration overrides.
345 #
346 # These overrides will affect all helm charts (ie. applications)
347 # that are listed below and are 'enabled'.
348 #################################################################
349 global:
350 <...>
351
352 #################################################################
353 # Enable/disable and configure helm charts (ie. applications)
354 # to customize the ONAP deployment.
355 #################################################################
356 aaf:
357 enabled: false
358 <...>
359 so: # Service Orchestrator
360 enabled: true
361
362 replicaCount: 1
363
364 liveness:
365 # necessary to disable liveness probe when setting breakpoints
366 # in debugger so K8s doesn't restart unresponsive container
367 enabled: true
368
369 <...>
370
371Accessing the ONAP Portal using OOM and a Kubernetes Cluster
372------------------------------------------------------------
373
374The ONAP deployment created by OOM operates in a private IP network that isn't
375publicly accessible (i.e. OpenStack VMs with private internal network) which
376blocks access to the ONAP Portal. To enable direct access to this Portal from a
377user's own environment (a laptop etc.) the portal application's port 8989 is
378exposed through a `Kubernetes LoadBalancer`_ object.
379
380Typically, to be able to access the Kubernetes nodes publicly a public address
381is assigned. In OpenStack this is a floating IP address.
382
383When the `portal-app` chart is deployed a Kubernetes service is created that
384instantiates a load balancer. The LB chooses the private interface of one of
385the nodes as in the example below (10.0.0.4 is private to the K8s cluster only).
386Then to be able to access the portal on port 8989 from outside the K8s &
387OpenStack environment, the user needs to assign/get the floating IP address that
388corresponds to the private IP as follows::
389
390 > kubectl -n onap get services|grep "portal-app"
391 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
392
393
394In this example, use the 10.0.0.4 private address as a key find the
395corresponding public address which in this example is 10.12.6.155. If you're
396using OpenStack you'll do the lookup with the horizon GUI or the OpenStack CLI
397for your tenant (openstack server list). That IP is then used in your
398`/etc/hosts` to map the fixed DNS aliases required by the ONAP Portal as shown
399below::
400
401 10.12.6.155 portal.api.simpledemo.onap.org
402 10.12.6.155 vid.api.simpledemo.onap.org
403 10.12.6.155 sdc.api.fe.simpledemo.onap.org
404 10.12.6.155 sdc.workflow.plugin.simpledemo.onap.org
405 10.12.6.155 sdc.dcae.plugin.simpledemo.onap.org
406 10.12.6.155 portal-sdk.simpledemo.onap.org
407 10.12.6.155 policy.api.simpledemo.onap.org
408 10.12.6.155 aai.api.sparky.simpledemo.onap.org
409 10.12.6.155 cli.api.simpledemo.onap.org
410 10.12.6.155 msb.api.discovery.simpledemo.onap.org
411 10.12.6.155 msb.api.simpledemo.onap.org
412 10.12.6.155 clamp.api.simpledemo.onap.org
413 10.12.6.155 so.api.simpledemo.onap.org
414 10.12.6.155 sdc.workflow.plugin.simpledemo.onap.org
415
416Ensure you've disabled any proxy settings the browser you are using to access
417the portal and then simply access now the new ssl-encrypted URL:
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +0100418``https://portal.api.simpledemo.onap.org:30225/ONAPPORTAL/login.htm``
Jakub Latusek222b48b2020-10-16 14:44:38 +0200419
420.. note::
421 Using the HTTPS based Portal URL the Browser needs to be configured to accept
422 unsecure credentials.
423 Additionally when opening an Application inside the Portal, the Browser
424 might block the content, which requires to disable the blocking and reloading
425 of the page
426
427.. note::
428 Besides the ONAP Portal the Components can deliver additional user interfaces,
429 please check the Component specific documentation.
430
431.. note::
432
433 | Alternatives Considered:
434
435 - Kubernetes port forwarding was considered but discarded as it would require
436 the end user to run a script that opens up port forwarding tunnels to each of
437 the pods that provides a portal application widget.
438
439 - Reverting to a VNC server similar to what was deployed in the Amsterdam
440 release was also considered but there were many issues with resolution, lack
441 of volume mount, /etc/hosts dynamic update, file upload that were a tall order
442 to solve in time for the Beijing release.
443
444 Observations:
445
446 - If you are not using floating IPs in your Kubernetes deployment and directly attaching
447 a public IP address (i.e. by using your public provider network) to your K8S Node
448 VMs' network interface, then the output of 'kubectl -n onap get services | grep "portal-app"'
449 will show your public IP instead of the private network's IP. Therefore,
450 you can grab this public IP directly (as compared to trying to find the floating
451 IP first) and map this IP in /etc/hosts.
452
453.. figure:: oomLogoV2-Monitor.png
454 :align: right
455
456Monitor
457=======
458
459All highly available systems include at least one facility to monitor the
460health of components within the system. Such health monitors are often used as
461inputs to distributed coordination systems (such as etcd, Zookeeper, or Consul)
462and monitoring systems (such as Nagios or Zabbix). OOM provides two mechanisms
463to monitor the real-time health of an ONAP deployment:
464
465- a Consul GUI for a human operator or downstream monitoring systems and
466 Kubernetes liveness probes that enable automatic healing of failed
467 containers, and
468- a set of liveness probes which feed into the Kubernetes manager which
469 are described in the Heal section.
470
471Within ONAP, Consul is the monitoring system of choice and deployed by OOM in
472two parts:
473
474- a three-way, centralized Consul server cluster is deployed as a highly
475 available monitor of all of the ONAP components, and
476- a number of Consul agents.
477
478The Consul server provides a user interface that allows a user to graphically
479view the current health status of all of the ONAP components for which agents
480have been created - a sample from the ONAP Integration labs follows:
481
482.. figure:: consulHealth.png
483 :align: center
484
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +0100485To see the real-time health of a deployment go to: ``http://<kubernetes IP>:30270/ui/``
Jakub Latusek222b48b2020-10-16 14:44:38 +0200486where a GUI much like the following will be found:
487
488
489.. figure:: oomLogoV2-Heal.png
490 :align: right
491
492Heal
493====
494
495The ONAP deployment is defined by Helm charts as mentioned earlier. These Helm
496charts are also used to implement automatic recoverability of ONAP components
497when individual components fail. Once ONAP is deployed, a "liveness" probe
498starts checking the health of the components after a specified startup time.
499
500Should a liveness probe indicate a failed container it will be terminated and a
501replacement will be started in its place - containers are ephemeral. Should the
502deployment specification indicate that there are one or more dependencies to
503this container or component (for example a dependency on a database) the
504dependency will be satisfied before the replacement container/component is
505started. This mechanism ensures that, after a failure, all of the ONAP
506components restart successfully.
507
508To test healing, the following command can be used to delete a pod::
509
510 > kubectl delete pod [pod name] -n [pod namespace]
511
512One could then use the following command to monitor the pods and observe the
513pod being terminated and the service being automatically healed with the
514creation of a replacement pod::
515
516 > kubectl get pods --all-namespaces -o=wide
517
518.. figure:: oomLogoV2-Scale.png
519 :align: right
520
521Scale
522=====
523
524Many of the ONAP components are horizontally scalable which allows them to
525adapt to expected offered load. During the Beijing release scaling is static,
526that is during deployment or upgrade a cluster size is defined and this cluster
527will be maintained even in the presence of faults. The parameter that controls
528the cluster size of a given component is found in the values.yaml file for that
529component. Here is an excerpt that shows this parameter:
530
531.. code-block:: yaml
532
533 # default number of instances
534 replicaCount: 1
535
536In order to change the size of a cluster, an operator could use a helm upgrade
537(described in detail in the next section) as follows::
538
539 > helm upgrade --set replicaCount=3 onap/so/mariadb
540
541The ONAP components use Kubernetes provided facilities to build clustered,
542highly available systems including: Services_ with load-balancers, ReplicaSet_,
543and StatefulSet_. Some of the open-source projects used by the ONAP components
544directly support clustered configurations, for example ODL and MariaDB Galera.
545
546The Kubernetes Services_ abstraction to provide a consistent access point for
547each of the ONAP components, independent of the pod or container architecture
548of that component. For example, SDN-C uses OpenDaylight clustering with a
549default cluster size of three but uses a Kubernetes service to and change the
550number of pods in this abstract this cluster from the other ONAP components
551such that the cluster could change size and this change is isolated from the
552other ONAP components by the load-balancer implemented in the ODL service
553abstraction.
554
555A ReplicaSet_ is a construct that is used to describe the desired state of the
556cluster. For example 'replicas: 3' indicates to Kubernetes that a cluster of 3
557instances is the desired state. Should one of the members of the cluster fail,
558a new member will be automatically started to replace it.
559
560Some of the ONAP components many need a more deterministic deployment; for
561example to enable intra-cluster communication. For these applications the
562component can be deployed as a Kubernetes StatefulSet_ which will maintain a
563persistent identifier for the pods and thus a stable network id for the pods.
564For example: the pod names might be web-0, web-1, web-{N-1} for N 'web' pods
565with corresponding DNS entries such that intra service communication is simple
566even if the pods are physically distributed across multiple nodes. An example
567of how these capabilities can be used is described in the Running Consul on
568Kubernetes tutorial.
569
570.. figure:: oomLogoV2-Upgrade.png
571 :align: right
572
573Upgrade
574=======
575
576Helm has built-in capabilities to enable the upgrade of pods without causing a
577loss of the service being provided by that pod or pods (if configured as a
578cluster). As described in the OOM Developer's Guide, ONAP components provide
579an abstracted 'service' end point with the pods or containers providing this
580service hidden from other ONAP components by a load balancer. This capability
581is used during upgrades to allow a pod with a new image to be added to the
582service before removing the pod with the old image. This 'make before break'
583capability ensures minimal downtime.
584
585Prior to doing an upgrade, determine of the status of the deployed charts::
586
587 > helm list
588 NAME REVISION UPDATED STATUS CHART NAMESPACE
589 so 1 Mon Feb 5 10:05:22 2018 DEPLOYED so-2.0.1 default
590
591When upgrading a cluster a parameter controls the minimum size of the cluster
592during the upgrade while another parameter controls the maximum number of nodes
593in the cluster. For example, SNDC configured as a 3-way ODL cluster might
594require that during the upgrade no fewer than 2 pods are available at all times
595to provide service while no more than 5 pods are ever deployed across the two
596versions at any one time to avoid depleting the cluster of resources. In this
597scenario, the SDNC cluster would start with 3 old pods then Kubernetes may add
598a new pod (3 old, 1 new), delete one old (2 old, 1 new), add two new pods (2
599old, 3 new) and finally delete the 2 old pods (3 new). During this sequence
600the constraints of the minimum of two pods and maximum of five would be
601maintained while providing service the whole time.
602
603Initiation of an upgrade is triggered by changes in the Helm charts. For
604example, if the image specified for one of the pods in the SDNC deployment
605specification were to change (i.e. point to a new Docker image in the nexus3
606repository - commonly through the change of a deployment variable), the
607sequence of events described in the previous paragraph would be initiated.
608
609For example, to upgrade a container by changing configuration, specifically an
610environment value::
611
612 > helm deploy onap onap/so --version 2.0.1 --set enableDebug=true
613
614Issuing this command will result in the appropriate container being stopped by
615Kubernetes and replaced with a new container with the new environment value.
616
617To upgrade a component to a new version with a new configuration file enter::
618
619 > helm deploy onap onap/so --version 2.0.2 -f environments/demo.yaml
620
621To fetch release history enter::
622
623 > helm history so
624 REVISION UPDATED STATUS CHART DESCRIPTION
625 1 Mon Feb 5 10:05:22 2018 SUPERSEDED so-2.0.1 Install complete
626 2 Mon Feb 5 10:10:55 2018 DEPLOYED so-2.0.2 Upgrade complete
627
628Unfortunately, not all upgrades are successful. In recognition of this the
629lineup of pods within an ONAP deployment is tagged such that an administrator
630may force the ONAP deployment back to the previously tagged configuration or to
631a specific configuration, say to jump back two steps if an incompatibility
632between two ONAP components is discovered after the two individual upgrades
633succeeded.
634
635This rollback functionality gives the administrator confidence that in the
636unfortunate circumstance of a failed upgrade the system can be rapidly brought
637back to a known good state. This process of rolling upgrades while under
638service is illustrated in this short YouTube video showing a Zero Downtime
639Upgrade of a web application while under a 10 million transaction per second
640load.
641
642For example, to roll-back back to previous system revision enter::
643
644 > helm rollback so 1
645
646 > helm history so
647 REVISION UPDATED STATUS CHART DESCRIPTION
648 1 Mon Feb 5 10:05:22 2018 SUPERSEDED so-2.0.1 Install complete
649 2 Mon Feb 5 10:10:55 2018 SUPERSEDED so-2.0.2 Upgrade complete
650 3 Mon Feb 5 10:14:32 2018 DEPLOYED so-2.0.1 Rollback to 1
651
652.. note::
653
654 The description field can be overridden to document actions taken or include
655 tracking numbers.
656
657Many of the ONAP components contain their own databases which are used to
658record configuration or state information. The schemas of these databases may
659change from version to version in such a way that data stored within the
660database needs to be migrated between versions. If such a migration script is
661available it can be invoked during the upgrade (or rollback) by Container
662Lifecycle Hooks. Two such hooks are available, PostStart and PreStop, which
663containers can access by registering a handler against one or both. Note that
664it is the responsibility of the ONAP component owners to implement the hook
665handlers - which could be a shell script or a call to a specific container HTTP
666endpoint - following the guidelines listed on the Kubernetes site. Lifecycle
667hooks are not restricted to database migration or even upgrades but can be used
668anywhere specific operations need to be taken during lifecycle operations.
669
670OOM uses Helm K8S package manager to deploy ONAP components. Each component is
671arranged in a packaging format called a chart - a collection of files that
672describe a set of k8s resources. Helm allows for rolling upgrades of the ONAP
673component deployed. To upgrade a component Helm release you will need an
674updated Helm chart. The chart might have modified, deleted or added values,
675deployment yamls, and more. To get the release name use::
676
677 > helm ls
678
679To easily upgrade the release use::
680
681 > helm upgrade [RELEASE] [CHART]
682
683To roll back to a previous release version use::
684
685 > helm rollback [flags] [RELEASE] [REVISION]
686
687For example, to upgrade the onap-so helm release to the latest SO container
688release v1.1.2:
689
690- Edit so values.yaml which is part of the chart
691- Change "so: nexus3.onap.org:10001/openecomp/so:v1.1.1" to
692 "so: nexus3.onap.org:10001/openecomp/so:v1.1.2"
693- From the chart location run::
694
695 > helm upgrade onap-so
696
697The previous so pod will be terminated and a new so pod with an updated so
698container will be created.
699
700.. figure:: oomLogoV2-Delete.png
701 :align: right
702
703Delete
704======
705
706Existing deployments can be partially or fully removed once they are no longer
707needed. To minimize errors it is recommended that before deleting components
708from a running deployment the operator perform a 'dry-run' to display exactly
709what will happen with a given command prior to actually deleting anything. For
710example::
711
712 > helm undeploy onap --dry-run
713
714will display the outcome of deleting the 'onap' release from the
715deployment.
716To completely delete a release and remove it from the internal store enter::
717
718 > helm undeploy onap
719
720One can also remove individual components from a deployment by changing the
721ONAP configuration values. For example, to remove `so` from a running
722deployment enter::
723
724 > helm undeploy onap-so
725
726will remove `so` as the configuration indicates it's no longer part of the
727deployment. This might be useful if a one wanted to replace just `so` by
728installing a custom version.