1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. Copyright 2018-2020 Amdocs, Bell Canada, Orange, Samsung
7 .. _Helm: https://docs.helm.sh/
8 .. _Helm Charts: https://github.com/kubernetes/charts
9 .. _Kubernetes: https://Kubernetes.io/
10 .. _Docker: https://www.docker.com/
11 .. _Nexus: https://nexus.onap.org/
12 .. _AWS Elastic Block Store: https://aws.amazon.com/ebs/
13 .. _Azure File: https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction
14 .. _GCE Persistent Disk: https://cloud.google.com/compute/docs/disks/
15 .. _Gluster FS: https://www.gluster.org/
16 .. _Kubernetes Storage Class: https://Kubernetes.io/docs/concepts/storage/storage-classes/
17 .. _Assigning Pods to Nodes: https://Kubernetes.io/docs/concepts/configuration/assign-pod-node/
20 .. _developer-guide-label:
25 .. figure:: oomLogoV2-medium.png
28 ONAP consists of a large number of components, each of which are substantial
29 projects within themselves, which results in a high degree of complexity in
30 deployment and management. To cope with this complexity the ONAP Operations
31 Manager (OOM) uses a Helm_ model of ONAP - Helm being the primary management
32 system for Kubernetes_ container systems - to drive all user driven life-cycle
33 management operations. The Helm model of ONAP is composed of a set of
34 hierarchical Helm charts that define the structure of the ONAP components and
35 the configuration of these components. These charts are fully parameterized
36 such that a single environment file defines all of the parameters needed to
37 deploy ONAP. A user of ONAP may maintain several such environment files to
38 control the deployment of ONAP in multiple environments such as development,
39 pre-production, and production.
41 The following sections describe how the ONAP Helm charts are constructed.
50 Linux containers allow for an application and all of its operating system
51 dependencies to be packaged and deployed as a single unit without including a
52 guest operating system as done with virtual machines. The most popular
53 container solution is Docker_ which provides tools for container management
54 like the Docker Host (dockerd) which can create, run, stop, move, or delete a
55 container. Docker has a very popular registry of containers images that can be
56 used by any Docker system; however, in the ONAP context, Docker images are
57 built by the standard CI/CD flow and stored in Nexus_ repositories. OOM uses
58 the "standard" ONAP docker containers and three new ones specifically created
61 Containers are isolated from each other primarily via name spaces within the
62 Linux kernel without the need for multiple guest operating systems. As such,
63 multiple containers can be deployed with little overhead such as all of ONAP
64 can be deployed on a single host. With some optimization of the ONAP components
65 (e.g. elimination of redundant database instances) it may be possible to deploy
66 ONAP on a single laptop computer.
70 A Helm chart is a collection of files that describe a related set of Kubernetes
71 resources. A simple chart might be used to deploy something simple, like a
72 memcached pod, while a complex chart might contain many micro-service arranged
73 in a hierarchy as found in the `aai` ONAP component.
75 Charts are created as files laid out in a particular directory tree, then they
76 can be packaged into versioned archives to be deployed. There is a public
77 archive of `Helm Charts`_ on GitHub that includes many technologies applicable
78 to ONAP. Some of these charts have been used in ONAP and all of the ONAP charts
79 have been created following the guidelines provided.
81 The top level of the ONAP charts is shown below:
88 │ ├── requirements.yaml
91 │ │ │ └── docker-entrypoint.sh
96 │ │ │ ├── configmap.yaml
97 │ │ │ ├── cronjob.yaml
100 │ │ ├── configmap.yaml
103 │ │ └── statefulset.yaml
108 │ │ ├── _createPassword.tpl
113 │ │ ├── _namespace.tpl
114 │ │ ├── _repository.tpl
115 │ │ ├── _resources.tpl
119 │ │ └── _tplValue.tpl
124 ├── requirements.yaml
128 The common section of charts consists of a set of templates that assist with
129 parameter substitution (`_name.tpl`, `_namespace.tpl` and others) and a set of
130 charts for components used throughout ONAP. When the common components are used
131 by other charts they are instantiated each time or we can deploy a shared
132 instances for several components.
134 All of the ONAP components have charts that follow the pattern shown below:
140 ├── requirements.yaml
142 │ └── subcomponent-folder
144 │ └── subchart-folder
156 │ ├── deployment.yaml
163 Note that the component charts / components may include a hierarchy of sub
164 components and in themselves can be quite complex.
166 You can use either `charts` or `components` folder for your subcomponents.
167 `charts` folder means that the subcomponent will always been deployed.
169 `components` folders means we can choose if we want to deploy the
172 This choice is done in root `values.yaml`:
185 Then in `requirements.yaml`, you'll use these values:
196 repository: 'file://components/component1'
197 condition: component1.enabled
200 repository: 'file://components/component2'
201 condition: component2.enabled
203 Configuration of the components varies somewhat from component to component but
204 generally follows the pattern of one or more `configmap.yaml` files which can
205 directly provide configuration to the containers in addition to processing
206 configuration files stored in the `config` directory. It is the responsibility
207 of each ONAP component team to update these configuration files when changes
208 are made to the project containers that impact configuration.
210 The following section describes how the hierarchical ONAP configuration system
211 is key to management of such a large system.
213 Configuration Management
214 ========================
216 ONAP is a large system composed of many components - each of which are complex
217 systems in themselves - that needs to be deployed in a number of different
218 ways. For example, within a single operator's network there may be R&D
219 deployments under active development, pre-production versions undergoing system
220 testing and production systems that are operating live networks. Each of these
221 deployments will differ in significant ways, such as the version of the
222 software images deployed. In addition, there may be a number of application
223 specific configuration differences, such as operating system environment
224 variables. The following describes how the Helm configuration management
225 system is used within the OOM project to manage both ONAP infrastructure
226 configuration as well as ONAP components configuration.
228 One of the artifacts that OOM/Kubernetes uses to deploy ONAP components is the
229 deployment specification, yet another yaml file. Within these deployment specs
230 are a number of parameters as shown in the following example:
238 app.kubernetes.io/name: zookeeper
239 helm.sh/chart: zookeeper
240 app.kubernetes.io/component: server
241 app.kubernetes.io/managed-by: Tiller
242 app.kubernetes.io/instance: onap-oof
243 name: onap-oof-zookeeper
250 app.kubernetes.io/name: zookeeper
251 app.kubernetes.io/component: server
252 app.kubernetes.io/instance: onap-oof
253 serviceName: onap-oof-zookeeper-headless
257 app.kubernetes.io/name: zookeeper
258 helm.sh/chart: zookeeper
259 app.kubernetes.io/component: server
260 app.kubernetes.io/managed-by: Tiller
261 app.kubernetes.io/instance: onap-oof
268 image: gcr.io/google_samples/k8szk:v3
269 imagePullPolicy: Always
272 - containerPort: 2181
275 - containerPort: 3888
278 - containerPort: 2888
283 Note that within the statefulset specification, one of the container arguments
284 is the key/value pair image: gcr.io/google_samples/k8szk:v3 which
285 specifies the version of the zookeeper software to deploy. Although the
286 statefulset specifications greatly simplify statefulset, maintenance of the
287 statefulset specifications themselves become problematic as software versions
288 change over time or as different versions are required for different
289 statefulsets. For example, if the R&D team needs to deploy a newer version of
290 mariadb than what is currently used in the production environment, they would
291 need to clone the statefulset specification and change this value. Fortunately,
292 this problem has been solved with the templating capabilities of Helm.
294 The following example shows how the statefulset specifications are modified to
295 incorporate Helm templates such that key/value pairs can be defined outside of
296 the statefulset specifications and passed during instantiation of the component.
303 name: {{ include "common.fullname" . }}
304 namespace: {{ include "common.namespace" . }}
305 labels: {{- include "common.labels" . | nindent 4 }}
307 replicas: {{ .Values.replicaCount }}
309 matchLabels: {{- include "common.matchLabels" . | nindent 6 }}
310 # serviceName is only needed for StatefulSet
311 # put the postfix part only if you have add a postfix on the service name
312 serviceName: {{ include "common.servicename" . }}-{{ .Values.service.postfix }}
316 labels: {{- include "common.labels" . | nindent 8 }}
317 annotations: {{- include "common.tplValue" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
318 name: {{ include "common.name" . }}
322 - name: {{ include "common.name" . }}
323 image: {{ .Values.image }}
324 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
326 {{- range $index, $port := .Values.service.ports }}
327 - containerPort: {{ $port.port }}
328 name: {{ $port.name }}
330 {{- range $index, $port := .Values.service.headlessPorts }}
331 - containerPort: {{ $port.port }}
332 name: {{ $port.name }}
336 This version of the statefulset specification has gone through the process of
337 templating values that are likely to change between statefulsets. Note that the
338 image is now specified as: image: {{ .Values.image }} instead of a
339 string used previously. During the statefulset phase, Helm (actually the Helm
340 sub-component Tiller) substitutes the {{ .. }} entries with a variable defined
341 in a values.yaml file. The content of this file is as follows:
346 image: gcr.io/google_samples/k8szk:v3
351 Within the values.yaml file there is an image key with the value
352 `gcr.io/google_samples/k8szk:v3` which is the same value used in
353 the non-templated version. Once all of the substitutions are complete, the
354 resulting statefulset specification ready to be used by Kubernetes.
356 When creating a template consider the use of default values if appropriate.
357 Helm templating has built in support for DEFAULT values, here is
363 - name: "{{ .Values.nsPrefix | default "onap" }}-docker-registry-key"
365 The pipeline operator ("|") used here hints at that power of Helm templates in
366 that much like an operating system command line the pipeline operator allow
367 over 60 Helm functions to be embedded directly into the template (note that the
368 Helm template language is a superset of the Go template language). These
369 functions include simple string operations like upper and more complex flow
370 control operations like if/else.
372 OOM is mainly helm templating. In order to have consistent deployment of the
373 different components of ONAP, some rules must be followed.
375 Templates are provided in order to create Kubernetes resources (Secrets,
376 Ingress, Services, ...) or part of Kubernetes resources (names, labels,
377 resources requests and limits, ...).
379 a full list and simple description is done in
380 `kubernetes/common/common/documentation.rst`.
385 In order to create a Service for a component, you have to create a file (with
386 `service` in the name.
387 For normal service, just put the following line:
391 {{ include "common.service" . }}
393 For headless service, the line to put is the following:
397 {{ include "common.headlessService" . }}
399 The configuration of the service is done in component `values.yaml`:
404 name: NAME-OF-THE-SERVICE
408 someAnnotationsKey: value
420 `annotations` and `postfix` keys are optional.
421 if `service.type` is `NodePort`, then you have to give `nodePort` value for your
422 service ports (which is the end of the computed nodePort, see example).
424 It would render the following Service Resource (for a component named
425 `name-of-my-component`, with version `x.y.z`, helm deployment name
426 `my-deployment` and `global.nodePortPrefix` `302`):
434 someAnnotationsKey: value
435 name: NAME-OF-THE-SERVICE-MY-POSTFIX
437 app.kubernetes.io/name: name-of-my-component
438 helm.sh/chart: name-of-my-component-x.y.z
439 app.kubernetes.io/instance: my-deployment-name-of-my-component
440 app.kubernetes.io/managed-by: Tiller
444 targetPort: tcp-MyPort
450 targetPort: https-api
453 app.kubernetes.io/name: name-of-my-component
454 app.kubernetes.io/instance: my-deployment-name-of-my-component
457 In the deployment or statefulSet file, you needs to set the good labels in
458 order for the service to match the pods.
460 here's an example to be sure it matches (for a statefulSet):
467 name: {{ include "common.fullname" . }}
468 namespace: {{ include "common.namespace" . }}
469 labels: {{- include "common.labels" . | nindent 4 }}
472 matchLabels: {{- include "common.matchLabels" . | nindent 6 }}
473 # serviceName is only needed for StatefulSet
474 # put the postfix part only if you have add a postfix on the service name
475 serviceName: {{ include "common.servicename" . }}-{{ .Values.service.postfix }}
479 labels: {{- include "common.labels" . | nindent 8 }}
480 annotations: {{- include "common.tplValue" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
481 name: {{ include "common.name" . }}
485 - name: {{ include "common.name" . }}
487 {{- range $index, $port := .Values.service.ports }}
488 - containerPort: {{ $port.port }}
489 name: {{ $port.name }}
491 {{- range $index, $port := .Values.service.headlessPorts }}
492 - containerPort: {{ $port.port }}
493 name: {{ $port.name }}
497 The configuration of the service is done in component `values.yaml`:
502 name: NAME-OF-THE-SERVICE
506 anotherAnnotationsKey : value
507 publishNotReadyAddresses: true
516 `headless.annotations`, `headless.postfix` and
517 `headless.publishNotReadyAddresses` keys are optional.
519 If `headless.postfix` is not set, then we'll add `-headless` at the end of the
522 If it set to `NONE`, there will be not postfix.
524 And if set to something, it will add `-something` at the end of the service
527 It would render the following Service Resource (for a component named
528 `name-of-my-component`, with version `x.y.z`, helm deployment name
529 `my-deployment` and `global.nodePortPrefix` `302`):
537 anotherAnnotationsKey: value
538 name: NAME-OF-THE-SERVICE
540 app.kubernetes.io/name: name-of-my-component
541 helm.sh/chart: name-of-my-component-x.y.z
542 app.kubernetes.io/instance: my-deployment-name-of-my-component
543 app.kubernetes.io/managed-by: Tiller
548 targetPort: tcp-MyPort
554 targetPort: https-api
556 publishNotReadyAddresses: true
558 app.kubernetes.io/name: name-of-my-component
559 app.kubernetes.io/instance: my-deployment-name-of-my-component
562 Previous example of StatefulSet would also match (except for the `postfix` part
565 Creating Deployment or StatefulSet
566 ----------------------------------
568 Deployment and StatefulSet should use the `apps/v1` (which has appeared in
570 As seen on the service part, the following parts are mandatory:
577 name: {{ include "common.fullname" . }}
578 namespace: {{ include "common.namespace" . }}
579 labels: {{- include "common.labels" . | nindent 4 }}
582 matchLabels: {{- include "common.matchLabels" . | nindent 6 }}
583 # serviceName is only needed for StatefulSet
584 # put the postfix part only if you have add a postfix on the service name
585 serviceName: {{ include "common.servicename" . }}-{{ .Values.service.postfix }}
589 labels: {{- include "common.labels" . | nindent 8 }}
590 annotations: {{- include "common.tplValue" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
591 name: {{ include "common.name" . }}
595 - name: {{ include "common.name" . }}
597 ONAP Application Configuration
598 ------------------------------
600 Dependency Management
601 ---------------------
602 These Helm charts describe the desired state
603 of an ONAP deployment and instruct the Kubernetes container manager as to how
604 to maintain the deployment in this state. These dependencies dictate the order
605 in-which the containers are started for the first time such that such
606 dependencies are always met without arbitrary sleep times between container
607 startups. For example, the SDC back-end container requires the Elastic-Search,
608 Cassandra and Kibana containers within SDC to be ready and is also dependent on
609 DMaaP (or the message-router) to be ready - where ready implies the built-in
610 "readiness" probes succeeded - before becoming fully operational. When an
611 initial deployment of ONAP is requested the current state of the system is NULL
612 so ONAP is deployed by the Kubernetes manager as a set of Docker containers on
613 one or more predetermined hosts. The hosts could be physical machines or
614 virtual machines. When deploying on virtual machines the resulting system will
615 be very similar to "Heat" based deployments, i.e. Docker containers running
616 within a set of VMs, the primary difference being that the allocation of
617 containers to VMs is done dynamically with OOM and statically with "Heat".
618 Example SO deployment descriptor file shows SO's dependency on its mariadb
621 SO deployment specification excerpt:
628 name: {{ include "common.fullname" . }}
629 namespace: {{ include "common.namespace" . }}
630 labels: {{- include "common.labels" . | nindent 4 }}
632 replicas: {{ .Values.replicaCount }}
634 matchLabels: {{- include "common.matchLabels" . | nindent 6 }}
638 app: {{ include "common.name" . }}
639 release: {{ .Release.Name }}
650 Kubernetes Container Orchestration
651 ==================================
652 The ONAP components are managed by the Kubernetes_ container management system
653 which maintains the desired state of the container system as described by one
654 or more deployment descriptors - similar in concept to OpenStack HEAT
655 Orchestration Templates. The following sections describe the fundamental
656 objects managed by Kubernetes, the network these components use to communicate
657 with each other and other entities outside of ONAP and the templates that
658 describe the configuration and desired state of the ONAP components.
662 Within the namespaces are Kubernetes services that provide external
663 connectivity to pods that host Docker containers.
665 ONAP Components to Kubernetes Object Relationships
666 --------------------------------------------------
667 Kubernetes deployments consist of multiple objects:
669 - **nodes** - a worker machine - either physical or virtual - that hosts
670 multiple containers managed by Kubernetes.
671 - **services** - an abstraction of a logical set of pods that provide a
673 - **pods** - one or more (but typically one) container(s) that provide specific
674 application functionality.
675 - **persistent volumes** - One or more permanent volumes need to be established
676 to hold non-ephemeral configuration and state data.
678 The relationship between these objects is shown in the following figure:
684 .. component Service {
693 .. figure:: kubernetes_objects.png
695 OOM uses these Kubernetes objects as described in the following sections.
699 OOM works with both physical and virtual worker machines.
701 * Virtual Machine Deployments - If ONAP is to be deployed onto a set of virtual
702 machines, the creation of the VMs is outside of the scope of OOM and could be
703 done in many ways, such as
705 * manually, for example by a user using the OpenStack Horizon dashboard or
707 * automatically, for example with the use of a OpenStack Heat Orchestration
708 Template which builds an ONAP stack, Azure ARM template, AWS CloudFormation
710 * orchestrated, for example with Cloudify creating the VMs from a TOSCA
711 template and controlling their life cycle for the life of the ONAP
714 * Physical Machine Deployments - If ONAP is to be deployed onto physical
715 machines there are several options but the recommendation is to use Rancher
716 along with Helm to associate hosts with a Kubernetes cluster.
720 A group of containers with shared storage and networking can be grouped
721 together into a Kubernetes pod. All of the containers within a pod are
722 co-located and co-scheduled so they operate as a single unit. Within ONAP
723 Amsterdam release, pods are mapped one-to-one to docker containers although
724 this may change in the future. As explained in the Services section below the
725 use of Pods within each ONAP component is abstracted from other ONAP
730 OOM uses the Kubernetes service abstraction to provide a consistent access
731 point for each of the ONAP components independent of the pod or container
732 architecture of that component. For example, the SDNC component may introduce
733 OpenDaylight clustering as some point and change the number of pods in this
734 component to three or more but this change will be isolated from the other ONAP
735 components by the service abstraction. A service can include a load balancer
736 on its ingress to distribute traffic between the pods and even react to dynamic
737 changes in the number of pods if they are part of a replica set.
741 To enable ONAP to be deployed into a wide variety of cloud infrastructures a
742 flexible persistent storage architecture, built on Kubernetes persistent
743 volumes, provides the ability to define the physical storage in a central
744 location and have all ONAP components securely store their data.
746 When deploying ONAP into a public cloud, available storage services such as
747 `AWS Elastic Block Store`_, `Azure File`_, or `GCE Persistent Disk`_ are
748 options. Alternatively, when deploying into a private cloud the storage
749 architecture might consist of Fiber Channel, `Gluster FS`_, or iSCSI. Many
750 other storage options existing, refer to the `Kubernetes Storage Class`_
751 documentation for a full list of the options. The storage architecture may vary
752 from deployment to deployment but in all cases a reliable, redundant storage
753 system must be provided to ONAP with which the state information of all ONAP
754 components will be securely stored. The Storage Class for a given deployment is
755 a single parameter listed in the ONAP values.yaml file and therefore is easily
756 customized. Operation of this storage system is outside the scope of the OOM.
760 Insert values.yaml code block with storage block here
762 Once the storage class is selected and the physical storage is provided, the
763 ONAP deployment step creates a pool of persistent volumes within the given
764 physical storage that is used by all of the ONAP components. ONAP components
765 simply make a claim on these persistent volumes (PV), with a persistent volume
766 claim (PVC), to gain access to their storage.
768 The following figure illustrates the relationships between the persistent
769 volume claims, the persistent volumes, the storage class, and the physical
775 label = "Persistance Volume Claim to Physical Storage Mapping"
777 node [shape=cylinder]
783 node [shape=Mrecord label="StorageClass:ceph"]
791 subgraph clusterSDC {
796 subgraph clusterSDNC {
815 # force all of these nodes to the same line in the given order
817 rank = same; PV0;PV1;PV2;PVn;p0;p1;p2
818 PV0->PV1->PV2->p0->p1->p2->PVn [style=invis]
822 rank = same; D0;D1;Dx;p3;p4;p5
823 D0->D1->p3->p4->p5->Dx [style=invis]
828 In-order for an ONAP component to use a persistent volume it must make a claim
829 against a specific persistent volume defined in the ONAP common charts. Note
830 that there is a one-to-one relationship between a PVC and PV. The following is
831 an excerpt from a component chart that defines a PVC:
835 Insert PVC example here
837 OOM Networking with Kubernetes
838 ------------------------------
841 - Ports - Flattening the containers also expose port conflicts between the
842 containers which need to be resolved.
849 OOM will use the rich set of Kubernetes node and pod affinity /
850 anti-affinity rules to minimize the chance of a single failure resulting in a
851 loss of ONAP service. Node affinity / anti-affinity is used to guide the
852 Kubernetes orchestrator in the placement of pods on nodes (physical or virtual
853 machines). For example:
855 - if a container used Intel DPDK technology the pod may state that it as
856 affinity to an Intel processor based node, or
857 - geographical based node labels (such as the Kubernetes standard zone or
858 region labels) may be used to ensure placement of a DCAE complex close to the
859 VNFs generating high volumes of traffic thus minimizing networking cost.
860 Specifically, if nodes were pre-assigned labels East and West, the pod
861 deployment spec to distribute pods to these nodes would be:
866 failure-domain.beta.Kubernetes.io/region: {{ .Values.location }}
868 - "location: West" is specified in the `values.yaml` file used to deploy
869 one DCAE cluster and "location: East" is specified in a second `values.yaml`
870 file (see OOM Configuration Management for more information about
871 configuration files like the `values.yaml` file).
873 Node affinity can also be used to achieve geographic redundancy if pods are
874 assigned to multiple failure domains. For more information refer to `Assigning
878 One could use Pod to Node assignment to totally constrain Kubernetes when
879 doing initial container assignment to replicate the Amsterdam release
880 OpenStack Heat based deployment. Should one wish to do this, each VM would
881 need a unique node name which would be used to specify a node constaint
882 for every component. These assignment could be specified in an environment
883 specific values.yaml file. Constraining Kubernetes in this way is not
886 Kubernetes has a comprehensive system called Taints and Tolerations that can be
887 used to force the container orchestrator to repel pods from nodes based on
888 static events (an administrator assigning a taint to a node) or dynamic events
889 (such as a node becoming unreachable or running out of disk space). There are
890 no plans to use taints or tolerations in the ONAP Beijing release. Pod
891 affinity / anti-affinity is the concept of creating a spacial relationship
892 between pods when the Kubernetes orchestrator does assignment (both initially
893 an in operation) to nodes as explained in Inter-pod affinity and anti-affinity.
894 For example, one might choose to co-located all of the ONAP SDC containers on a
895 single node as they are not critical runtime components and co-location
896 minimizes overhead. On the other hand, one might choose to ensure that all of
897 the containers in an ODL cluster (SDNC and APPC) are placed on separate nodes
898 such that a node failure has minimal impact to the operation of the cluster.
899 An example of how pod affinity / anti-affinity is shown below:
901 Pod Affinity / Anti-Affinity
908 name: with-pod-affinity
912 requiredDuringSchedulingIgnoredDuringExecution:
919 topologyKey: failure-domain.beta.Kubernetes.io/zone
921 preferredDuringSchedulingIgnoredDuringExecution:
930 topologyKey: Kubernetes.io/hostname
932 - name: with-pod-affinity
933 image: gcr.io/google_containers/pause:2.0
935 This example contains both podAffinity and podAntiAffinity rules, the first
936 rule is is a must (requiredDuringSchedulingIgnoredDuringExecution) while the
937 second will be met pending other considerations
938 (preferredDuringSchedulingIgnoredDuringExecution). Preemption Another feature
939 that may assist in achieving a repeatable deployment in the presence of faults
940 that may have reduced the capacity of the cloud is assigning priority to the
941 containers such that mission critical components have the ability to evict less
942 critical components. Kubernetes provides this capability with Pod Priority and
943 Preemption. Prior to having more advanced production grade features available,
944 the ability to at least be able to re-deploy ONAP (or a subset of) reliably
945 provides a level of confidence that should an outage occur the system can be
946 brought back on-line predictably.
951 Monitoring of ONAP components is configured in the agents within JSON files and
952 stored in gerrit under the consul-agent-config, here is an example from the AAI
953 model loader (aai-model-loader-health.json):
959 "name": "A&AI Model Loader",
962 "id": "model-loader-process",
963 "name": "Model Loader Presence",
964 "script": "/consul/config/scripts/model-loader-script.sh",
975 These liveness probes can simply check that a port is available, that a
976 built-in health check is reporting good health, or that the Consul health check
977 is positive. For example, to monitor the SDNC component has following liveness
978 probe can be found in the SDNC DB deployment specification:
982 sdnc db liveness probe
986 command: ["mysqladmin", "ping"]
987 initialDelaySeconds: 30 periodSeconds: 10
990 The 'initialDelaySeconds' control the period of time between the readiness
991 probe succeeding and the liveness probe starting. 'periodSeconds' and
992 'timeoutSeconds' control the actual operation of the probe. Note that
993 containers are inherently ephemeral so the healing action destroys failed
994 containers and any state information within it. To avoid a loss of state, a
995 persistent volume should be used to store all data that needs to be persisted
996 over the re-creation of a container. Persistent volumes have been created for
997 the database components of each of the projects and the same technique can be
998 used for all persistent state information.
1008 The \ `Microservices Bus
1009 Project <https://wiki.onap.org/pages/viewpage.action?pageId=3246982>`__ provides
1010 facilities to integrate micro-services into ONAP and therefore needs to
1011 integrate into OOM - primarily through Consul which is the backend of
1012 MSB service discovery. The following is a brief description of how this
1013 integration will be done:
1015 A registrator to push the service endpoint info to MSB service
1018 - The needed service endpoint info is put into the kubernetes yaml file
1019 as annotation, including service name, Protocol,version, visual
1020 range,LB method, IP, Port,etc.
1022 - OOM deploy/start/restart/scale in/scale out/upgrade ONAP components
1024 - Registrator watch the kubernetes event
1026 - When an ONAP component instance has been started/destroyed by OOM,
1027 Registrator get the notification from kubernetes
1029 - Registrator parse the service endpoint info from annotation and
1030 register/update/unregister it to MSB service discovery
1032 - MSB API Gateway uses the service endpoint info for service routing
1035 Details of the registration service API can be found at \ `Microservice
1037 Documentation <https://wiki.onap.org/display/DW/Microservice+Bus+API+Documentation>`__.
1039 ONAP Component Registration to MSB
1040 ----------------------------------
1041 The charts of all ONAP components intending to register against MSB must have
1042 an annotation in their service(s) template. A `sdc` example follows:
1044 .. code-block:: yaml
1052 namespace: "{{ .Values.nsPrefix }}"
1054 msb.onap.org/service-info: '[
1056 "serviceName": "sdc",
1064 "serviceName": "sdc-deprecated",
1076 MSB Integration with OOM
1077 ------------------------
1078 A preliminary view of the OOM-MSB integration is as follows:
1080 .. figure:: MSB-OOM-Diagram.png
1082 A message sequence chart of the registration process:
1086 participant "OOM" as oom
1087 participant "ONAP Component" as onap
1088 participant "Service Discovery" as sd
1089 participant "External API Gateway" as eagw
1090 participant "Router (Internal API Gateway)" as iagw
1092 box "MSB" #LightBlue
1098 == Deploy Servcie ==
1101 oom -> sd: Register service endpoints
1102 sd -> eagw: Services exposed to external system
1103 sd -> iagw: Services for internal use
1105 == Component Life-cycle Management ==
1107 oom -> onap: Start/Stop/Scale/Migrate/Upgrade
1108 oom -> sd: Update service info
1109 sd -> eagw: Update service info
1110 sd -> iagw: Update service info
1112 == Service Health Check ==
1114 sd -> onap: Check the health of service
1115 sd -> eagw: Update service status
1116 sd -> iagw: Update service status
1119 MSB Deployment Instructions
1120 ---------------------------
1121 MSB is helm installable ONAP component which is often automatically deployed.
1122 To install it individually enter::
1124 > helm install <repo-name>/msb
1127 TBD: Vaidate if the following procedure is still required.
1129 Please note that Kubernetes authentication token must be set at
1130 *kubernetes/kube2msb/values.yaml* so the kube2msb registrator can get the
1131 access to watch the kubernetes events and get service annotation by
1132 Kubernetes APIs. The token can be found in the kubectl configuration file
1135 More details can be found here `MSB installation <https://docs.onap.org/projects/onap-msb-apigateway/en/latest/platform/installation.html>`_.
1139 .. Note that although OOM uses Kubernetes facilities to minimize the effort
1140 .. required of the ONAP component owners to implement a successful rolling
1141 .. upgrade strategy there are other considerations that must be taken into
1143 .. For example, external APIs - both internal and external to ONAP - should be
1144 .. designed to gracefully accept transactions from a peer at a different
1145 .. software version to avoid deadlock situations. Embedded version codes in
1146 .. messages may facilitate such capabilities.
1148 .. Within each of the projects a new configuration repository contains all of
1149 .. the project specific configuration artifacts. As changes are made within
1150 .. the project, it's the responsibility of the project team to make appropriate
1151 .. changes to the configuration data.