Configuration

The TSA loads configuration data from a file (typically backed by a Kubernetes config map). The location of the configuration file is sourced from an environment variable. 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

TSA uses its service for communication with other services and load balancing across replicas (for example, see 3/ISM). You can control the values with the following configuration options:

service:
  instance:
    name: <string>          # Service instance name, should be unique cluster-wide. "tsa" by default.
    replica.id: <string>    # Service instance replica ID, should be unique cluster-wide. Random string by default.
  graceful-shutdown: <uint> # Allowed service graceful shutdown period in seconds. 30 seconds by default.

Data persistence interface

TSA uses Open Distro to store the traffic report events. The below parameters configure Open Distro interface.

By default, Open Distro username, password and address are sourced from the environment variables.

kaa:
  elastic:
    bulk-processor:
      workers-count: <number>                       # Workers count (more then 0)
      flush-interval: <duration string>             # Interval between batch requests (more then 5s and less then 5m) 
      flush-bytes: <string>                         # Size of one bulk item in bytes (more then 1024 B) 
      index-template-pattern: <string>              # Pattern for all tenants indexes (by default "kaa-system-traffic-statistics")
      batch-timeout: <duration string>              # Timeout for single batch request
      bulk-timeout: <duration string>               # Timeout for single bulk item request
    server:
      address: <string>                             # Open Distro client address for connection
      username: <string>                            # Open Distro client username for connection
      password: <string>                            # Open Distro client password for connection
      max-retries: <int>                            # Connection retries before raising an error
    transport:
      max-idle-conn-duration: <duration string>     # Transport max idle connection duration (by default: 30s)
      read-timeout: <duration string>               # Transport read timeout (by default 15s)
      write-timeout: <duration string>              # Transport write timeout (by default 15s)

NATS

The below parameters configure TSA connection to NATS, as well as the NATS message adapters used by TSA. 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.
kaa.elce.receiver:
  from: <string>          # Originator service name (kpc for example)
  concurrency: <int>      # The maximum amount of concurrent goroutines to read and process incoming 9/ELCE NATS messages. 8 by default.
  queue-length: <int>     # The maximum amount of messages in the ELCE receiver queue. When the queue is full, new messages will be dropped. 16 * concurrency by default.

Monitoring

To control the TSA management interface, use the following configuration options.

service.monitoring:
  disabled: <boolean>   # Disables the monitoring interface entirely. False by default (enabled).
  port: <uint>          # TCP port to expose the monitoring server on. 8080 by default.

Logging

TSA writes logs to stdout. By default, the service only produces logs at startup, shutdown, or in case of errors. To enable debug level logging, use the following option:

service:
  debug: <boolean>    # Enables debug level logging, false by default (disabled).

Default configuration

Summarizing the above, the default TSA configuration is as follows.

service:
  instance:
    name: "tsa"
    replica.id: "<random string generated on boot>"
  monitoring:
    disabled: false
  graceful-shutdown: 30
  debug: true
kaa:
  elastic:
    server:
      transport:
        max-idle-conn-duration: 30s
        read-timeout: 15s
        write-timeout: 15s
      max-retries: 5
    bulk-processor:
      workers-count: 10
      flush-timeout: 10s
      flush-bytes: 4096B
      index-template-pattern: "kaa-system-traffic-statistics"
      batch-timeout: 60s
      bulk-timeout: 10s
  elce:
    receiver:
      from: kpc
      concurrency: 8
      queue-length: 128