Skip to content

Small utility to synchronize configuration to consul's kv store.

Notifications You must be signed in to change notification settings

LeisureLink/consul-kv-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

consul-kv-sync

Synchronizes a json document with key-value pairs in Consul. Will add, update, and delete keys as necessary.

Usage:

$ echo '{"my-api":{"global-key":"value"}' > my-api-global.json
$ echo '{"my-api":{"environment-key":"env value"}' > my-api-environment.json
$ consul-kv-sync --host localhost --port 8500 \
    my-api-global.json my-api-environment.json

Full help

  Usage: consul-kv-sync [options] <file ...>

  Synchronizes one or more JSON manifests with consul's key value store.

  Options:

    -h, --help         output usage information
    -V, --version      output the version number
    -H, --host <host>  Consul API url. Environment variable: CONSUL_HOST. Default: consul.service.consul
    -p, --port <port>  Consul API port. Environment variable: CONSUL_PORT. Default: 8500
    -s, --secure       Enable HTTPS. Environment variable: CONSUL_SECURE.
    --ca <ca>          Path to trusted certificate in PEM format. Specify multiple times for multiple certificates.
    -v, --verbose      If present, verbose output provided.

  Examples:

    $ consul-kv-sync my-service-global.json my-service-dev.json
    $ CONSUL_HOST=consul.local consul-kv-sync my-service-global.json my-service-dev.json
    $ consul-kv-sync --host localhost --port 8500 --secure \
        --ca root-ca.pem --ca intermediate-ca.pem \
        my-service-global.json my-service-dev.json

About

Small utility to synchronize configuration to consul's kv store.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •