Service configuration overrides

Service configs allow you to provide HOCON configuration that overrides a service’s application.conf. This is useful for tuning settings per environment without rebuilding the service image.

A service config is a named resource in an Akka project. Once created, it can be associated with a service. When the service starts, the configuration from the service config is loaded and overrides matching keys in the service’s bundled application.conf.

Managing service configs

Creating a service config

Create a service config from a HOCON file:

akka service-configs create my-config --from-file /path/to/config.conf

The file should contain valid HOCON configuration. For example:

config.conf
some.setting = "value"
another.setting = 42

You can also read from stdin using - as the file path:

cat config.conf | akka service-configs create my-config --from-file -

If a service config with the given name already exists, it will be updated with the new content.

Listing service configs

akka service-configs list

Getting a service config

akka service-configs get my-config

Deleting a service config

akka service-configs delete my-config
A service config cannot be deleted while it is referenced by a service.

Associating a service config with a service

To apply a service config to a service:

akka services set-config my-service --service-config my-config

The service config must exist before it can be associated with a service. After setting the config, restart the service for changes to take effect.

To remove the association:

akka services remove-config my-service

A service config can also be referenced in a service descriptor using the serviceConfig field:

name: my-service
service:
  image: my-image:1.0.0
  serviceConfig: my-config
  resources:
    runtime:
      mode: embedded