.. This work is licensed under a Creative Commons Attribution 4.0 International License. .. http://creativecommons.org/licenses/by/4.0 .. Copyright 2018 Amdocs, Bell Canada .. Links .. _Curated applications for Kubernetes: https://github.com/kubernetes/charts .. _Services: https://kubernetes.io/docs/concepts/services-networking/service/ .. _ReplicaSet: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ .. _StatefulSet: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/ .. _Helm Documentation: https://docs.helm.sh/helm/ .. _Helm: https://docs.helm.sh/ .. _Kubernetes: https://Kubernetes.io/ .. _Kubernetes LoadBalancer: https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer .. _user-guide-label: OOM User Guide ############## The ONAP Operations Manager (OOM) provide the ability to manage the entire life-cycle of an ONAP installation, from the initial deployment to final decommissioning. This guide provides instructions for users of ONAP to use the Kubernetes_/Helm_ system as a complete ONAP management system. This guide provides many examples of Helm command line operations. For a complete description of these commands please refer to the `Helm Documentation`_. .. figure:: oomLogoV2-medium.png :align: right The following sections describe the life-cycle operations: - Deploy_ - with built-in component dependency management - Configure_ - unified configuration across all ONAP components - Monitor_ - real-time health monitoring feeding to a Consul UI and Kubernetes - Heal_- failed ONAP containers are recreated automatically - Scale_ - cluster ONAP services to enable seamless scaling - Upgrade_ - change-out containers or configuration with little or no service impact - Delete_ - cleanup individual containers or entire deployments .. figure:: oomLogoV2-Deploy.png :align: right Deploy ====== The OOM team with assistance from the ONAP project teams, have built a comprehensive set of Helm charts, yaml files very similar to TOSCA files, that describe the composition of each of the ONAP components and the relationship within and between components. Using this model Helm is able to deploy all of ONAP with a few simple commands. Pre-requisites -------------- Your environment must have both the Kubernetes `kubectl` and Helm setup as a one time activity. Install Kubectl ~~~~~~~~~~~~~~~ Enter the following to install kubectl (on Ubuntu, there are slight differences on other O/Ss), the Kubernetes command line interface used to manage a Kubernetes cluster:: > curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.8.10/bin/linux/amd64/kubectl > chmod +x ./kubectl > sudo mv ./kubectl /usr/local/bin/kubectl > mkdir ~/.kube Paste kubectl config from Rancher (see the :ref:`cloud-setup-guide-label` for alternative Kubenetes environment setups) into the `~/.kube/config` file. Verify that the Kubernetes config is correct:: > kubectl get pods --all-namespaces At this point you should see six Kubernetes pods running. Install Helm ~~~~~~~~~~~~ Helm is used by OOM for package and configuration management. To install Helm, enter the following:: > wget http://storage.googleapis.com/kubernetes-helm/helm-v2.8.2-linux-amd64.tar.gz > tar -zxvf helm-v2.8.2-linux-amd64.tar.gz > sudo mv linux-amd64/helm /usr/local/bin/helm Verify the Helm version with:: > helm version Install the Helm Tiller application and initialize with:: > helm init Install the Helm Repo --------------------- Once kubectl and Helm are setup, one needs to setup a local Helm server to server up the ONAP charts:: > helm install osn/onap .. note:: The osn repo is not currently available so creation of a local repository is required. Helm is able to use charts served up from a repository and comes setup with a default CNCF provided `Curated applications for Kubernetes`_ repository called stable which should be removed to avoid confusion:: > helm repo remove stable .. To setup the Open Source Networking Nexus repository for helm enter:: .. > helm repo add osn 'https://nexus3.onap.org:10001/helm/helm-repo-in-nexus/master/' To prepare your system for an installation of ONAP, you'll need to:: > git clone -b beijing http://gerrit.onap.org/r/oom > cd oom/kubernetes To setup a local Helm server to server up the ONAP charts:: > helm init > helm serve & Note the port number that is listed and use it in the Helm repo add as follows:: > helm repo add local http://127.0.0.1:8879 To get a list of all of the available Helm chart repositories:: > helm repo list NAME URL local http://127.0.0.1:8879 Then build your local Helm repository:: > make all The Helm search command reads through all of the repositories configured on the system, and looks for matches:: > helm search -l NAME VERSION DESCRIPTION local/appc 2.0.0 Application Controller local/clamp 2.0.0 ONAP Clamp local/common 2.0.0 Common templates for inclusion in other charts local/onap 2.0.0 Open Network Automation Platform (ONAP) local/robot 2.0.0 A helm Chart for kubernetes-ONAP Robot local/so 2.0.0 ONAP Service Orchestrator In any case, setup of the Helm repository is a one time activity. Once the repo is setup, installation of ONAP can be done with a single command:: > helm install local/onap --name development This will install ONAP from a local repository in a 'development' Helm release. As described below, to override the default configuration values provided by OOM, an environment file can be provided on the command line as follows:: > helm install local/onap --name development -f onap-development.yaml To get a summary of the status of all of the pods (containers) running in your deployment:: > kubectl get pods --all-namespaces -o=wide .. note:: The Kubernetes namespace concept allows for multiple instances of a component (such as all of ONAP) to co-exist with other components in the same Kubernetes cluster by isolating them entirely. Namespaces share only the hosts that form the cluster thus providing isolation between production and development systems as an example. The OOM deployment of ONAP in Beijing is now done within a single Kubernetes namespace where in Amsterdam a namespace was created for each of the ONAP components. .. note:: The Helm `--name` option refers to a release name and not a Kubernetes namespace. To install a specific version of a single ONAP component (`so` in this example) with the given name enter:: > helm install onap/so --version 2.0.1 -n so To display details of a specific resource or group of resources type:: > kubectl describe pod so-1071802958-6twbl where the pod identifier refers to the auto-generated pod identifier. .. figure:: oomLogoV2-Configure.png :align: right Configure ========= Each project within ONAP has its own configuration data generally consisting of: environment variables, configuration files, and database initial values. Many technologies are used across the projects resulting in significant operational complexity and an inability to apply global parameters across the entire ONAP deployment. OOM solves this problem by introducing a common configuration technology, Helm charts, that provide a hierarchical configuration with the ability to override values with higher level charts or command line options. The structure of the configuration of ONAP is shown in the following diagram. Note that key/value pairs of a parent will always take precedence over those of a child. Also note that values set on the command line have the highest precedence of all. .. graphviz:: digraph config { { node [shape=folder] oValues [label="values.yaml"] demo [label="onap-demo.yaml"] prod [label="onap-production.yaml"] oReq [label="requirements.yaml"] soValues [label="values.yaml"] soReq [label="requirements.yaml"] mdValues [label="values.yaml"] } { oResources [label="resources"] } onap -> oResources onap -> oValues oResources -> environments oResources -> oReq oReq -> so environments -> demo environments -> prod so -> soValues so -> soReq so -> charts charts -> mariadb mariadb -> mdValues } The top level onap/values.yaml file contains the values required to be set before deploying ONAP. Here is the contents of this file: .. include:: onap_values.yaml :code: yaml One may wish to create a value file that is specific to a given deployment such that it can be differentiated from other deployments. For example, a onap-development.yaml file may create a minimal environment for development while onap-production.yaml might describe a production deployment that operates independently of the developer version. For example, if the production OpenStack instance was different from a developer's instance, the onap-production.yaml file may contain a different value for the vnfDeployment/openstack/oam_network_cidr key as shown below. .. code-block:: yaml nsPrefix: onap nodePortPrefix: 302 apps: consul msb mso message-router sdnc vid robot portal policy appc aai sdc dcaegen2 log cli multicloud clamp vnfsdk aaf kube2msb dataRootDir: /dockerdata-nfs # docker repositories repository: onap: nexus3.onap.org:10001 oom: oomk8s aai: aaionap filebeat: docker.elastic.co image: pullPolicy: Never # vnf deployment environment vnfDeployment: openstack: ubuntu_14_image: "Ubuntu_14.04.5_LTS" public_net_id: "e8f51956-00dd-4425-af36-045716781ffc" oam_network_id: "d4769dfb-c9e4-4f72-b3d6-1d18f4ac4ee6" oam_subnet_id: "191f7580-acf6-4c2b-8ec0-ba7d99b3bc4e" oam_network_cidr: "192.168.30.0/24" <...> To deploy ONAP with this environment file, enter:: > helm install local/onap -n beijing -f environments/onap-production.yaml .. include:: environments_onap_demo.yaml :code: yaml When deploying all of ONAP a requirements.yaml file control which and what version of the ONAP components are included. Here is an excerpt of this file: .. code-block:: yaml # Referencing a named repo called 'local'. # Can add this repo by running commands like: # > helm serve # > helm repo add local http://127.0.0.1:8879 dependencies: <...> - name: so version: ~2.0.0 repository: '@local' condition: so.enabled <...> The ~ operator in the `so` version value indicates that the latest "2.X.X" version of `so` shall be used thus allowing the chart to allow for minor upgrades that don't impact the so API; hence, version 2.0.1 will be installed in this case. The onap/resources/environment/onap-dev.yaml (see the excerpt below) enables for fine grained control on what components are included as part of this deployment. By changing this `so` line to `enabled: false` the `so` component will not be deployed. If this change is part of an upgrade the existing `so` component will be shut down. Other `so` parameters and even `so` child values can be modified, for example the `so`'s `liveness` probe could be disabled (which is not recommended as this change would disable auto-healing of `so`). .. code-block:: yaml ################################################################# # Global configuration overrides. # # These overrides will affect all helm charts (ie. applications) # that are listed below and are 'enabled'. ################################################################# global: <...> ################################################################# # Enable/disable and configure helm charts (ie. applications) # to customize the ONAP deployment. ################################################################# aaf: enabled: false <...> so: # Service Orchestrator enabled: true replicaCount: 1 liveness: # necessary to disable liveness probe when setting breakpoints # in debugger so K8s doesn't restart unresponsive container enabled: true <...> Accessing the ONAP Portal using OOM and a Kubernetes Cluster ------------------------------------------------------------ The ONAP deployment created by OOM operates in a private IP network that isn't publicly accessible (i.e. Openstack VMs with private internal network) which blocks access to the ONAP Portal. To enable direct access to this Portal from a user's own environment (a laptop etc.) the portal application's port 8989 is exposed through a `Kubernetes LoadBalancer`_ object. Typically, to be able to access the Kubernetes nodes publicly a public address is assigned. In Openstack this is a floating IP address. When the `portal-app` chart is deploye
<?xml version="1.0"?>
<!--
================================================================================
Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
============LICENSE_END=========================================================

ECOMP is a trademark and service mark of AT&T Intellectual Property.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0   http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.onap.oparent</groupId>
    <artifactId>oparent</artifactId>
    <version>1.1.0</version>
  </parent>
  <!--- CHANGE THE FOLLOWING 3 OBJECTS for your own repo -->
  <groupId>org.onap.dcaegen2.platform</groupId>
  <artifactId>deployment-handler</artifactId>
  <name>dcaegen2-platform-deployment-handler</name>
  <version>2.1.0-SNAPSHOT</version>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <sonar.skip>true</sonar.skip>
    <sonar.sources>.</sonar.sources>
    <!-- customize the SONARQUBE URL -->
    <!-- sonar.host.url>http://localhost:9000</sonar.host.url -->
    <!-- below are language dependent -->
    <!-- for Python -->
    <sonar.language>py</sonar.language>
    <sonar.pluginName>Python</sonar.pluginName>
    <sonar.inclusions>**/*.py</sonar.inclusions>
    <!-- for JavaScaript -->
    <!--
    <sonar.language>js</sonar.language>
    <sonar.pluginName>JS</sonar.pluginName>
    <sonar.inclusions>**/*.js</sonar.inclusions>
    -->
  </properties>
  <build>
    <finalName>${project.artifactId}-${project.version}</finalName>
    <pluginManagement>
      <plugins>
        <!-- the following plugins are invoked from oparent, we do not need them -->
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.7</version>
          <configuration>