Table of Contents | ||
---|---|---|
|
...
ONAP services need to be registered to MSB to leverage the service discovery/routing/LB capabilities of MSB. The below table is the information MSB need for service registration.
See also the complementary set official reference list of externally exposed ports for OOM at OOM NodePort List - until most of the ports are generated dynamically
Attribute | Description | Required |
---|---|---|
Service Name | An unique name of the service, it should be constant so the service consumer can access the service. Service name recommendation:
| Yes |
Service Type | api or ui | Yes |
Version | Service version. Only the major version is used in the URI. RESTful API Design Specification for ONAPSpecification#Versioning | Yes |
URL | The actual URL of the service to be registered | Yes |
Customized Path | The customized publish path of this service. If this parameter is specified when registering the service, the service will be published to api gateway under this path. Otherwise, the service will be published to api gateway using a fixed format: api/{serviceName} /{version}. The customized publish path should only be used for back-compatible. | No |
Published URL | If "Customized Path" attribute is not specified,The published URL is the fixed format api/{serviceName} /{version} . If "Customized Path" attribute is specified,The published URL is the same as the "Customized Path". | Yes |
Visual Range | Visibility of the service. External(can be accessed by external systems):0 Internal(can only be accessed by ONAP microservices):1 | Yes |
LB Method | Load balancing method used when MSB routes the service requests. Currently, Round robin and IP hash are supported. | Yes |
Port | The service endpoint port. | Yes |
Enable SSL | True if the registered service is based on https. False if the registered service is based on http. Default is False. | No |
...
The collected service endpoint information will be added to OOM deployment blueprint, which is kubernetes configuration file in Amsterdam release.
OOM deploy MSB as the first component
OOM deploy Registrator, which watches the kubernetes POD events
OOM deploy other ONAP components,like AAI, Poliy, SO,VFC, APPC, etc.
Registrator get notified with the POD event, then get the service information form POD environment variables and service instance(POD) IP from kubernetes
Registrator registers the service endpoint info to MSB
MSB use these service info to route service requests
Backwards compatible
While trying to provide consistent RESTful APIs to ONAP developers and users, some projects may also want to support their current API version until an appropriate time to deprecate it. In Service information to be registered to MSB can be added as an annotation "msb.onap.org/service-info" to K8s service spec YAML.
Example:
Code Block |
---|
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.service.portName }}
namespace: {{ include "common.namespace" . }}
labels:
app: {{ include "common.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
annotations:
msb.onap.org/service-info: '[
{
"serviceName": "multicloud",
"version": "v0",
"url": "/api/multicloud/v0",
"protocol": "REST",
"port": "{{ .Values.service.externalPort }}",
"enable_ssl": {{ .Values.config.ssl_enabled }},
"visualRange": "1"
},
{
"serviceName": "multicloud",
"version": "v1",
"url": "/api/multicloud/v1",
"protocol": "REST",
"port": "{{ .Values.service.externalPort }}",
"enable_ssl": {{ .Values.config.ssl_enabled }},
"visualRange": "1"
}
]'
spec:
ports:
{{if eq .Values.service.type "NodePort" -}}
- port: {{ .Values.service.externalPort }}
nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
name: {{ .Values.service.portName }}
{{- else -}}
- port: {{ .Values.service.externalPort }}
targetPort: {{ .Values.service.internalPort }}
name: {{ .Values.service.portName }}
{{- end}}
selector:
app: {{ include "common.name" . }}
release: {{ include "common.release" . }}
type: {{ .Values.service.type }} |
Backwards compatible
While trying to provide consistent RESTful APIs to ONAP developers and users, some projects may also want to support their current API version until an appropriate time to deprecate it. In case of that, two service endpoints can be defined for a service, one for the consistent, standard way and one for backwards compatible.
The customized publish path of this service attribute can be used to support the current API. If this parameter is specified when registering the service, the service will be published to api gateway under the specified customer path other than the the fixed format: api/{serviceName} /{version}.
for example, A&AI defines two services for its Cloud Infrastructure API, the "aai-cloudInfrastructure" is published under /api/aai-cloudInfrastructure/v1/ which is the consistent, standard API URL, and the "aai-cloudInfrastructure-deprecated" is published under /cloud-infrastructure/ which is the same as its current API URL.
...
Service Name | Description | Service Type | version | URL | Customized Path | Published URL | Visual Range | LB Method | Port | Enable SSL |
---|---|---|---|---|---|---|---|---|---|---|
holmes-rule-mgmt | The rule management module of Holmes | api | 1 | /api/holmes-rule-mgmt/v1/ | N/A | /api/holmes-rule-mgmt/v1/ | Internal | Round robin | 9101 | False |
holmes-engine-mgmt | The engine management module of Holmes | api | 1 | /api/holmes-engine-/mgmt/v1/ | N/A | /api/holmes-engine-mgmt/v1/ | Internal | Round robin | 9102 | False |
holmes-dmaap-dsa | The data source adapter module of Holmes | api | 1 | /api/holmes-dmaap-dsa/v1/ | N/A | /api/holmes-dmaap-dsa/v1/ | Internal | Round robin | 9103 | False |
...
Service Name | Description | Service Type | version | URL | Cstomized Path | Published URL | Visual Range | LB Method | Port | Enable SSL |
---|---|---|---|---|---|---|---|---|---|---|
portal | RESTful service provided by Portal Platform | api | 2 | / | N/A | /api/portal/v2/ | Internal | Round robin | 8989 |
Usecase UI
...