The consul_kv datasource allows Jerakia to retreive values from Hashicorp Consul using the key value store features (Consul KV)
Global configuration for consul is placed in
jerakia.yaml under the
consul configuration key. The following configuration options are supported. Jerakia uses the Diplomat library to integrate with Consul KV
url: HTTP URL to connect to the Consul KV API, default: http://localhost:8500
acl_token: Optional ACL token to supply with the API requests
options: A hash of options to provide to Faraday, see the Diplomat documentation for information
The following options are available when declaring the consul_kv datasource within a Jerakia lookup
datacenter: A string, Optionally specify a dc (datacenter) for the lookup
to_hash: Boolean, default: true. Will consolidate the results into a hash instead of an array.
recursive: Boolean, default: false. Will return the entire data structure from Consul KV rather than just the requested key
searchpath: Array, default: [ ‘/’ ]. A set of prefixes, Jerakia will iterate through each level of the searchpath appending the namespace and lookup key
Data can now be looked up hierarchically.
The key that gets passed to Consul KV consists of the search prefix