Skip to content
Le Gall, Benoit edited this page May 2, 2024 · 8 revisions

Description

Alternative to git2consul which is not maintained anymore.

Concept: give a tool to easily push content in Consul KV to be used as distributed configurations

Global Configurations

  • consul.host: Consul host. Defaults to localhost (Required)
  • consul.port: Consul port. Defaults to 8500 (Required)
  • consul.secured: Set whether Consul is secured. Defaults to false (Optional)
  • consul.acl-token: ACL token needed to read and write in KV path. When present, will be added to requests using ?token query parameter (Optional)
  • consul.dc: Consul datacenter name. When present, will be added to requests using ?dc query parameter (Optional)
  • consul.timeout: Amount of time (in milliseconds) for requests (Optional)
  • consul.type: (FILES | GIT) Type of data used to be export into Consul (Required)
  • consul.kv.prefix: Prefix for the KV path where the configuration is stored. Defaults to config (Required)
  • consul.kv.version: Version of the configuration. When present, will be used in the KV path (Optional)

About the KV name

If you need to use environment (Micronaut) or profile (Spring), you will have to name your KV according to the format: {key},{environment} like explained in the following table

Key path Description
/config/application Configuration shared by all applications
/config/application,XXX Configuration shared by all applications for the XXX Environment/Profile
/config/[APPLICATION_NAME] Application-specific configuration, example /config/hello-world
/config/[APPLICATION_NAME],XXX Application-specific configuration for the XXX Environment/Profile

For more details, read Micronaut#HashiCorp Consul Support - Storing Configuration as Key/Value Pairs

Clone this wiki locally