Configuration
The CM 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
CM uses a standard Spring Boot server.port
property to configure the port to expose the REST API at.
The service-specific configuration properties are located under kaa.cm
.
server:
port: <unsigned short integer> # Server port used to expose the REST API at
kaa:
cm:
ep-token:
length: <integer> # Controls the length of CM-generated endpoint tokens
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>:
versions:
<application 1 version 1 name>:
Tekton
CM 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.
Endpoint register interface
Use the below parameters to configure the REST-based endpoint register interface CM uses to listen to EP unregistered events.
kaa:
cm:
ep-register:
service-instance:
name: <service instance name> # Instance name of the endpoint register
Data persistence interface
CM 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 CM has been tested with MariaDB data source only.
NATS
The below parameters configure CM’s connection to NATS.
NOTE For security, reasons NATS username and password are sourced from the environment variables.
nats:
urls: <comma separated list of URL> # NATS connection URLs
Authentication and authorization
CM’s REST API security is implemented according to OAuth2 protocol with a UMA profile. CM use auth-kaa-server-starter for protecting its REST API. CM use auth-kaa-client-starter for executing authenticated REST API calls to other services.
There’re two security configuration points:
1) Configure CM’s HTTP client to include security header in requests to other secured services:
security:
oauth2:
client:
enabled: <boolean> # Specified if authentication is enabled for CM REST calls. False by default.
base-url: <URL> # Base host url to OAuth provider
realm: <realm name> # Realm in OAuth provider
clientId: <client ID> # Client ID on whose behalf the requests will be made
clientSecret: <client secret> # Client secret on whose behalf the requests will be made
2) Secure REST API provided by CM by enabling authorization and authentication:
security:
ignored: <value> # Controls authentication and authorization on REST API endpoints.
# Possible values: '/**' to disable security or 'none' to enable.
oauth2:
client:
clientId: <clientId> # Client id on whose behalf the requests will be made
clientSecret: <secret> # Client secret on whose behalf the requests will be made
accessTokenUri: <URI> # An OAuth2-compliant Token Endpoint for obtaining tokens via the 'Implicit Flow', 'Direct Grants', or 'Client Grants'. E.g. "https://your-url-to-auth-server/auth/realms/realm-a/protocol/openid-connect/token"
resourceUri: <URI> # An UMA-compliant Resource Registration Endpoint which resource servers can use to manage their protected resources and scopes. E.g. "https://your-url-to-auth-server/auth/realms/realm-a/authz/protection/resource_set"
resource:
userInfoUri: <URI> # This is the URL endpoint for the User Info service described in the OIDC specification. E.g. "https://your-url-to-auth-server/auth/realms/realm-a/protocol/openid-connect/userinfo"
Management
CM 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, CM 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, CM comes with a default built-in configuration profile.
You can control which profiles are enabled with spring.profiles.active
parameter.
Built-in profiles are optimized for a Kubernetes-based production deployment. They do not define any Kaa applications—you have to configure them for a specific Kaa-based solution.
Default
server:
port: 80
kaa:
cm:
ep-token:
length: 10
ep-register:
base-url: http://epr
service-instance:
name: epr
spring:
datasource:
url: jdbc:mariadb://mariadb:3306/cm
nats:
urls: nats://nats:4222
management:
server:
port: 8080
endpoint:
health:
enabled: true
show-details: always
status:
http-mapping:
UNKNOWN: SERVICE_UNAVAILABLE
shutdown:
enabled: true
metrics:
enabled: true
endpoints:
web:
base-path: /
exposure:
include: info,health,metrics
security:
ignored: /**