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