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