close

Filter

loading table of contents...

Deployment Manual / Version 2406.1

Table Of Contents

2.4.2.2 Use confd to Render Configuration Files at Startup

Since coremedia/java-application-base:2.1.6 confd is included in the base image. Confd is a tool to render configuration files using GO templates and a special set of template functions from confd.

Confd expects its configuration located at /etc/confd/conf.d defined using toml syntax and its templates /etc/confd/templates. Each template to render requires a separate configuration file.

The management-tools container is by default outfitted with templates for:

  • UAPI connections using capclient.properties

  • resetcaefeeder using `resetcaefeeder.properties

  • sql tools using sql.properties

  • workflowconverter using workflowserver.properties

The templates have been designed, so that the environment keys would be the same as if the tool would accept the Spring Boot environment variable to Spring property transformation. For the UAPI connection, this means, that defining CAP_CLIENT_SERVER_IOR_URL would result in rendering cap.client.server.ior.url.

The advantage of using confd over mounting configuration files is that confd allows setting a key path prefix on the command-line which allows us to define multiple environments within the same configuration source.

For convenience purposes in the development setup, three prefixes are preconfigured within the management-tools image:

  • dev/management

  • dev/master

  • dev/replication

You can easily switch between them by using the convenience function tools-context included in the bashrc profile:

$ tools-context dev/master
[DOCKER ENTRYPOINT] - entering /coremedia/confd
[DOCKER ENTRYPOINT] - running confd with backend "env" and prefix "dev/master"
[DOCKER ENTRYPOINT] - entrypoint chain finished

Using confd to configure tools within a container can be especially useful when developing custom UAPI clients, without Spring configuration techniques, that should run as daemonized services within a container.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.