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:
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.
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