Configuration

The OTAO loads configuration data from a file (typically backed by a Kubernetes config map). If the service is unable to retrieve the configuration data, it will not start. Refer to the configuration for details.

Service configuration structure

The recommended configuration format is YAML. The below sections describe the officially supported configuration options that influence various aspects of the service functionality. The service may support options other than the ones listed below, but those are not a part of the public API and may be changed or deleted at any time.

General service configuration

OTAO uses a standard Spring Boot server.port property to configure the port to expose the REST API at.

server:
  port: <unsigned short integer>   # Server port used to expose the REST API at

Kaa applications

Many Kaa services can be configured for different behavior depending on the application version of the endpoint the processed data relates to. This is called appversion-specific behavior and is handled in service configurations under kaa.applications. Alternatively, the application-specific configuration can be sourced from Kaa Tekton. See the Tekton configuration section to find out how to configure such integration.

kaa:
  applications:
    <application 1 name>:                  # Kaa application name
      versions:
        <application 1 version 1 name>:    # Kaa application version name

Tekton

OTAO supports integration with Kaa Tekton for centralized application configuration management. The below configuration options set up the integration interface.

kaa:
  tekton:
    enabled: <boolean>    # Enables Tekton integration. False by default. Also can be set with the KAA_TEKTON_ENABLED environment variable.
    url: <string>         # URL of the Tekton service. "http://tekton" by default. Also can be set with the KAA_TEKTON_URL environment variable.
  scmp.consumer:
    provider.service-instance.name: <string>  # Service instance name of the Tekton service. "tekton" by default. Also can be set with the KAA_SCMP_CONSUMER_PROVIDER_SERVICE_INSTANCE_NAME environment variable. 

Configuration data transport interface

Use the following options to configure the configuration data transport interface.

kaa:
  otao:
    software-consumer:
      service-instance:
        name: <service instance name>  # Name of the software data consumer service instance OTAO will subscribe to.

Endpoint filters management transport interface

Use the following options to configure the EP lifecycle, EP filters and EP filters management transport interfaces.

kaa:
  otao:
    endpoint-filter:
      originator:
        service-instance:
          name: <service instance name>  # Name of the endpoint filter originator service instance OTAO will communicate to.

Data persistence interface

OTAO uses Spring Boot datasource configuration. Refer to the corresponding documentation for the list of supported configuration options.

NOTE For security reasons, username and password must be sourced from the environment variables.

NOTE OTAO has been tested with MariaDB data source only.

NATS

The below parameters configure OTAO’s connection to NATS. Note that for security reasons NATS username and password are sourced from the environment variables.

nats:
  urls: <comma separated list of URL>   # NATS connection URLs

Authentication, authorization, and multi-tenancy

OTAO’s REST API security is implemented according to OAuth2 protocol with a UMA profile.

Authentication and authorization is handled within the scope of a given Kaa tenant. Each tenant has a separate OAuth 2.0 issuer, managed by [the Kaa Tenant Manager][Tenant Manager]. When multi-tenancy is disabled, all authentication and authorization is conducted in the default system tenant (“kaa”).

OTAO security is controlled with the following configuration options (for security reasons it is advised to set these via environment variables).

kaa:
  security:
    enabled: <boolean>       # Enables authentication and authorization. False by default.
    issuer: <string>         # OAuth 2.0 issuer URL for the system tenant ("kaa").
    client-id: <string>      # Client ID for making requests in the system tenant scope.
    client-secret: <string>  # Client secret for making requests in the system tenant scope.

    multitenancy:
      enabled: <boolean>    # Enables multitenancy via integration with the Kaa Tenant Manager. Only effective when kaa.security.enabled is set to true. False by default.
      tenant-manager:
        url: <string>       # URL of the Kaa Tenant Manager that provides security configurations for tenants. "http://tenant-manager" by default.

Management

OTAO monitoring and management implementation is based on the Spring Boot Actuator. Refer to the corresponding documentation for the list of supported configuration options.

Logging

By default, OTAO uses Spring Boot logging configuration with logback for logging. Refer to the corresponding documentation for the list of supported configuration options.

Built-in configuration profiles

For your convenience, OTAO comes with a default built-in configuration profile.

Built-in profile is optimized for a Kubernetes-based production deployment. It does not define any Kaa applications—you have to configure those for any specific Kaa-based solution.

Default

server:
  port: 80

nats:
  urls: nats://nats:4222

management:
  port: 8080
  security:
    enabled: false

endpoints:
  enabled: false
  health:
    enabled: true
    mapping.UNKNOWN: SERVICE_UNAVAILABLE
  info.enabled: true
  metrics.enabled: true

spring:
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    driver-class-name: org.mariadb.jdbc.Driver
    username: ${mariadb.username}
    password: ${mariadb.password}
    url: jdbc:mariadb://mariadb:3306/kaa
    hikari:
      idle-timeout: 10000
      minimum-idle: 5
      maximum-pool-size: 40
      data-source-properties:
        cachePrepStmts: true
        prepStmtCacheSize: 250
        prepStmtCacheSqlLimit: 2048
        useServerPrepStmts: true
  jpa:
    generate-ddl: true
    show-sql: false
    properties:
      hibernate:
        jdbc.time_zone: UTC

kaa:
  otao:
    endpoint-filter:
      originator:
        service-instance:
          name: epr
    software-consumer:
      service-instance:
        name: cmx