Skip to content
Le Gall, Benoit edited this page May 3, 2024 · 6 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.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)

When running the CLI jar

  1. All arguments have to be passed in the format --{property}
  2. All properties but sensitive are logged in INFO at start of execution
  3. There is an additional argument --dry-run that will not run the import

so point 2 & 3 can be used to debug

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