.. 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 .. _Helm: https://docs.helm.sh/ .. _Helm Charts: https://github.com/kubernetes/charts .. _Kubernetes: https://Kubernetes.io/ .. _Docker: https://www.docker.com/ .. _Nexus: https://nexus.onap.org/#welcome .. _AWS Elastic Block Store: https://aws.amazon.com/ebs/ .. _Azure File: https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction .. _GCE Persistent Disk: https://cloud.google.com/compute/docs/disks/ .. _Gluster FS: https://www.gluster.org/ .. _Kubernetes Storage Class: https://Kubernetes.io/docs/concepts/storage/storage-classes/ .. _Assigning Pods to Nodes: https://Kubernetes.io/docs/concepts/configuration/assign-pod-node/ .. _developer-guide-label: OOM Developer Guide ################### .. figure:: oomLogoV2-medium.png :align: right ONAP consists of a large number of components, each of which are substantial projects within themselves, which results in a high degree of complexity in deployment and management. To cope with this complexity the ONAP Operations Manager (OOM) uses a Helm_ model of ONAP - Helm being the primary management system for Kubernetes_ container systems - to drive all user driven life-cycle management operations. The Helm model of ONAP is composed of a set of hierarchical Helm charts that define the structure of the ONAP components and the configuration of these components. These charts are fully parameterized such that a single environment file defines all of the parameters needed to deploy ONAP. A user of ONAP may maintain several such environment files to control the deployment of ONAP in multiple environments such as development, pre-production, and production. The following sections describe how the ONAP Helm charts are constructed. .. contents:: :depth: 3 :local: .. Container Background ==================== Linux containers allow for an application and all of its operating system dependencies to be packaged and deployed as a single unit without including a guest operating system as done with virtual machines. The most popular container solution is Docker_ which provides tools for container management like the Docker Host (dockerd) which can create, run, stop, move, or delete a container. Docker has a very popular registry of containers images that can be used by any Docker system; however, in the ONAP context, Docker images are built by the standard CI/CD flow and stored in Nexus_ repositories. OOM uses the "standard" ONAP docker containers and three new ones specifically created for OOM. Containers are isolated from each other primarily via name spaces within the Linux kernel without the need for multiple guest operating systems. As such, multiple containers can be deployed with little overhead such as all of ONAP can be deployed on a single host. With some optimization of the ONAP components (e.g. elimination of redundant database instances) it may be possible to deploy ONAP on a single laptop computer. Helm Charts =========== A Helm chart is a collection of files that describe a related set of Kubernetes resources. A simple chart might be used to deploy something simple, like a memcached pod, while a complex chart might contain many micro-service arranged in a hierarchy as found in the `aai` ONAP component. Charts are created as files laid out in a particular directory tree, then they can be packaged into versioned archives to be deployed. There is a public archive of `Helm Charts`_ on GitHub that includes many technologies applicable to ONAP. Some of these charts have been used in ONAP and all of the ONAP charts have been created following the guidelines provided. The top level of the ONAP charts is shown below: .. code-block:: bash common ├── cassandra │ ├── Chart.yaml │ ├── requirements.yaml │ ├── resources │ │ ├── config │ │ │ └── docker-entrypoint.sh │ │ ├── exec.py │ │ └── restore.sh │ ├── templates │ │ ├── backup │ │ │ ├── configmap.yaml │ │ │ ├── cronjob.yaml │ │ │ ├── pv.yaml │ │ │ └── pvc.yaml │ │ ├── configmap.yaml │ │ ├── pv.yaml │ │ ├── service.yaml │ │ └── statefulset.yaml │ └── values.yaml ├── common │ ├── Chart.yaml │ ├── templates │ │ ├── _createPassword.tpl │ │ ├── _ingress.tpl │ │ ├── _labels.tpl │ │ ├── _mariadb.tpl │ │ ├── _name.tpl │ │ ├── _namespace.tpl │ │ ├── _repository.tpl │ │ ├── _resources.tpl │ │ ├── _secret.yaml │ │ ├── _service.tpl │ │ ├── _storage.tpl │ │ └── _tplValue.tpl │ └── values.yaml ├── ... └── postgres-legacy ├── Chart.yaml ├── requirements.yaml ├── charts └── configs The common section of charts consists of a set of templates that assist with parameter substitution (`_name.tpl`, `_namespace.tpl` and others) and a set of charts for components used throughout ONAP. When the common components are used by other charts they are instantiated each time or we can deploy a shared instances for several components. All of the ONAP components have charts that follow the pattern shown below: .. code-block:: bash name-of-my-component ├── Chart.yaml ├── requirements.yaml ├── component │ └── subcomponent-folder ├── charts │ └── subchart-folder ├── resources │ ├── folder1 │ │ ├── file1 │ │ └── file2 │ └── folder1 │ ├── file3 │ └── folder3 │ └── file4 ├── templates │ ├── NOTES.txt │ ├── configmap.yaml │ ├── deployment.yaml │ ├── ingress.yaml │ ├── job.yaml │ ├── secrets.yaml │ └── service.yaml └── values.yaml Note that the component charts / components may include a hierarchy of sub components and in themselves can be quite complex. You can use either `charts` or `components` folder for your subcomponents. `charts` folder means that the subcomponent will always been deployed. `components` folders means we can choose if we want to deploy the sub component. This choice is done in root `values.yaml`: .. code-block:: yaml --- global: key: value component1: enabled: true component2: enabled: true Then in `requirements.yaml`, you'll use these values: .. code-block:: yaml --- dependencies: - name: common version: ~x.y-0 repository: '@local' - name: component1 version: ~x.y-0 repository: 'file://components/component1' condition: component1.enabled - name: component2 version: ~x.y-0 repository: 'file://components/component2' condition: component2.enabled Configuration of the components varies somewhat from component to component but generally follows the pattern of one or more `configmap.yaml` files which can directly provide configuration to the containers in addition to processing configuration files stored in the `config` directory. It is the responsibility of each ONAP component team to update these configuration files when changes are made to the project containers that impact configuration. The following section describes how the hierarchical ONAP configuration system is key to management of such a large system. Configuration Management ======================== ONAP is a large system composed of many components - each of which are complex systems in themselves - that needs to be deployed in a number of different ways. For example, within a single operator's network there may be R&D deployments under active development, pre-production versions undergoing system testing and production systems that are operating live networks. Each of these deployments will differ in significant ways, such as the version of the software images deployed. In addition, there may be a number of application specific configuration differences, such as operating system environment variables. The following describes how the Helm configuration management system is used within the OOM project to manage both ONAP infrastructure configuration as well as ONAP components configuration. One of the artifacts that OOM/Kubernetes uses to deploy ONAP components is the deployment specification, yet another yaml file. Within these deployment specs are a number of parameters as shown in the following example: .. code-block:: yaml apiVersion: apps/v1 kind: StatefulSet metadata: labels: app.kubernetes.io/name: zookeeper helm.sh/chart: zookeeper app.kubernetes.io/component: server app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: onap-oof name: onap-oof-zookeeper namespace: onap spec: <...> replicas: 3 selector: matchLabels: app.kubernetes.io/name: zookeeper app.kubernetes.io/component: server app.kubernetes.io/instance: onap-oof serviceName: onap-oof-zookeeper-headless template: metadata: labels: app.kubernetes.io/name: zookeeper helm.sh/chart: zookeeper app.kubernetes.io/component: server app.kubernetes.io/managed-by: Tiller app.kubernetes.io/instance: onap-oof spec: <...> affinity: containers: - name: zookeeper <...> image: gcr.io/google_samples/k8szk:v3 imagePullPolicy: Always <...> ports: - containerPort: 2181 name: client protocol: TCP - containerPort: 3888 name: election protocol: TCP - containerPort: 2888 name: server protocol: TCP <...> Note that within the statefulset specification, one of the container arguments is the key/value pair image: gcr.io/google_samples/k8szk:v3 which specifies the version of the zookeeper software to deploy. Although the statefulset specifications greatly simplify statefulset, maintenance of the statefulset specifications themselves become problematic as software versions change over time or as different versions are required for different statefulsets. For example, if the R&D team needs to deploy a newer version of mariadb than what is currently used in the production environment, they would need to clone the statefulset specification and change this value. Fortunately, this problem has been solved with the templating capabilities of Helm. The following example shows how the statefulset specifications are modified to incorporate Helm templates such that key/value pairs can be defined outside of the statefulset specifications and passed during instantiation of the component. .. code-block:: yaml apiVersion: apps/v1 kind: StatefulSet metadata: name: {{ include "common.fullname" . }} namespace: {{ include "common.namespace" . }} labels: {{- include "common.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "common.matchLabels" . | nindent 6 }} # serviceName is only needed for StatefulSet # put the postfix part only if you have add a postfix on the service name
.. This work is licensed under a
.. Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. Copyright 2019-2020 Amdocs, Bell Canada, Orange, Samsung
.. _oom_quickstart_guide:
.. _quick-start-label:
OOM Quick Start Guide
#####################
.. figure:: oomLogoV2-medium.png
:align: right
Once a Kubernetes environment is available (follow the instructions in
:ref:`cloud-setup-guide-label` if you don't have a cloud environment
available), follow the following instructions to deploy ONAP.
**Step 1.** Clone the OOM repository from ONAP gerrit::
> git clone -b <BRANCH> http://gerrit.onap.org/r/oom --recurse-submodules
> cd oom/kubernetes
where <BRANCH> can be an official release tag, such as
* 4.0.0-ONAP for Dublin
* 5.0.1-ONAP for El Alto
* 6.0.0 for Frankfurt
**Step 2.** Install Helm Plugins required to deploy ONAP::
> sudo cp -R ~/oom/kubernetes/helm/plugins/ ~/.helm
**Step 3.** Customize the Helm charts like `oom/kubernetes/onap/values.yaml` or
an override file like `onap-all.yaml`, `onap-vfw.yaml` or `openstack.yaml` file
to suit your deployment with items like the OpenStack tenant information.
.. note::
Standard and example override files (e.g. `onap-all.yaml`, `openstack.yaml`) can be found in
the `oom/kubernetes/onap/resources/overrides/` directory.
a. You may want to selectively enable or disable ONAP components by changing
the ``enabled: true/false`` flags.
b. Encrypt the OpenStack password using the shell tool for Robot and put it in
the Robot Helm charts or Robot section of `openstack.yaml`
c. Encrypt the OpenStack password using the java based script for SO Helm charts
or SO section of `openstack.yaml`.
d. Update the OpenStack parameters that will be used by Robot, SO and APPC Helm
charts or use an override file to replace them.
e. Add in the command line a value for the global master password (global.masterPassword).
a. Enabling/Disabling Components:
Here is an example of the nominal entries that need to be provided.
We have different values file available for different contexts.
.. literalinclude:: ../kubernetes/onap/values.yaml
:language: yaml
b. Generating ROBOT Encrypted Password:
The Robot encrypted Password uses the same encryption.key as SO but an
openssl algorithm that works with the python based Robot Framework.
.. note::
To generate Robot ``openStackEncryptedPasswordHere``::
cd so/resources/config/mso/
/oom/kubernetes/so/resources/config/mso# echo -n "<openstack tenant password>" | openssl aes-128-ecb -e -K `cat encryption.key` -nosalt | xxd -c 256 -p``
c. Generating SO Encrypted Password:
The SO Encrypted Password uses a java based encryption utility since the
Java encryption library is not easy to integrate with openssl/python that
Robot uses in Dublin and upper versions.
.. note::
To generate SO ``openStackEncryptedPasswordHere`` and ``openStackSoEncryptedPassword``
ensure `default-jdk` is installed::
apt-get update; apt-get install default-jdk
Then execute::
SO_ENCRYPTION_KEY=`cat ~/oom/kubernetes/so/resources/config/mso/encryption.key`
OS_PASSWORD=XXXX_OS_CLEARTESTPASSWORD_XXXX
git clone http://gerrit.onap.org/r/integration
cd integration/deployment/heat/onap-rke/scripts
javac Crypto.java
java Crypto "$OS_PASSWORD" "$SO_ENCRYPTION_KEY"
d. Update the OpenStack parameters:
There are assumptions in the demonstration VNF Heat templates about the
networking available in the environment. To get the most value out of these
templates and the automation that can help confirm the setup is correct, please
observe the following constraints.
``openStackPublicNetId:``
This network should allow Heat templates to add interfaces.
This need not be an external network, floating IPs can be assigned to the
ports on the VMs that are created by the heat template but its important that
neutron allow ports to be created on them.
``openStackPrivateNetCidr: "10.0.0.0/16"``
This ip address block is used to assign OA&M addresses on VNFs to allow ONAP
connectivity. The demonstration Heat templates assume that 10.0 prefix can be
used by the VNFs and the demonstration ip addressing plan embodied in the
preload template prevent conflicts when instantiating the various VNFs. If
you need to change this, you will need to modify the preload data in the
Robot Helm chart like integration_preload_parameters.py and the
demo/heat/preload_data in the Robot container. The size of the CIDR should
be sufficient for ONAP and the VMs you expect to create.
``openStackOamNetworkCidrPrefix: "10.0"``
This ip prefix mush match the openStackPrivateNetCidr and is a helper
variable to some of the Robot scripts for demonstration. A production
deployment need not worry about this setting but for the demonstration VNFs
the ip asssignment strategy assumes 10.0 ip prefix.
Example Keystone v2.0
.. literalinclude:: example-integration-override.yaml
:language: yaml
Example Keystone v3 (required for Rocky and later releases)
.. literalinclude:: example-integration-override-v3.yaml
:language: yaml
**Step 4.** To setup a local Helm server to server up the ONAP charts::
> 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
**Step 5.** Verify your Helm repository setup with::
> helm repo list
NAME URL
local http://127.0.0.1:8879
**Step 6.** Build a local Helm repository (from the kubernetes directory)::
> make SKIP_LINT=TRUE all; make SKIP_LINT=TRUE onap
**Step 7.** Display the onap charts that available to be deployed::
> helm search onap -l
.. literalinclude:: helm-search.txt
.. note::
The setup of the Helm repository is a one time activity. If you make changes
to your deployment charts or values be sure to use ``make`` to update your
local Helm repository.
**Step 8.** Once the repo is setup, installation of ONAP can be done with a
single command
.. note::
The ``--timeout 900`` is currently required in Dublin and up to address long
running initialization tasks for DMaaP and SO. Without this timeout value both
applications may fail to deploy.
.. danger::
We've added the master password on the command line.
You shouldn't put it in a file for safety reason
please don't forget to change the value to something random
A space is also added in front of the command so "history" doesn't catch it.
This masterPassword is very sensitive, please be careful!
To deploy all ONAP applications use this command::
> cd oom/kubernetes
> helm deploy dev local/onap --namespace onap --set global.masterPassword=myAwesomePasswordThatINeedToChange -f onap/resources/overrides/onap-all.yaml -f onap/resources/overrides/environment.yaml -f onap/resources/overrides/openstack.yaml --timeout 900
All override files may be customized (or replaced by other overrides) as per
needs.
`onap-all.yaml`
Enables the modules in the ONAP deployment. As ONAP is very modular, it is
possible to customize ONAP and disable some components through this
configuration file.
`onap-all-ingress-nginx-vhost.yaml`
Alternative version of the `onap-all.yaml` but with global ingress controller
enabled. It requires the cluster configured with the nginx ingress controller
and load balancer. Please use this file instead `onap-all.yaml` if you want
to use experimental ingress controller feature.
`environment.yaml`
Includes configuration values specific to the deployment environment.
Example: adapt readiness and liveness timers to the level of performance of
your infrastructure
`openstack.yaml`
Includes all the OpenStack related information for the default target tenant
you want to use to deploy VNFs from ONAP and/or additional parameters for the
embedded tests.
**Step 9.** Verify ONAP installation
Use the following to monitor your deployment and determine when ONAP is ready
for use::
> kubectl get pods -n onap -o=wide
.. note::
While all pods may be in a Running state, it is not a guarantee that all components are running fine.
Launch the healthcheck tests using Robot to verify that the components are healthy::
> ~/oom/kubernetes/robot/ete-k8s.sh onap health
**Step 10.** Undeploy ONAP
::
> helm undeploy dev --purge
More examples of using the deploy and undeploy plugins can be found here: https://wiki.onap.org/display/DW/OOM+Helm+%28un%29Deploy+plugins