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