Mirrors a file directory to a Consul Key-Value (KV) Store
529
dir2consul mirrors a filesystem directory to a Consul Key-Value (KV) Store
A files path and name, with the file extension removed, becomes the Consul Key while the contents of the file are the Value. Note that mirroring is exact which includes deleting any Consul Keys that are not present in the source files. Hidden files and directories, those beginning with ".", are always skipped.
dir2consul uses environment variables to override default configuration values. The variables are:
Consul specific configuration variables are documented here and may be used to customize dir2consul connectivity to a Consul server.
Read more about regular expression syntax to get the desired behavior with the D2C_IGNORE_DIR_REGEX and D2C_IGNORE_FILE_REGEX configuration options.
The following command does a dry run of mirroring the present working directory (PWD) to the Consul server KV store under the path "some/specific/kv/path".
docker run -v $(PWD):/local \
--env CONSUL_HTTP_ADDR=consul.example.com:8500 \
--env D2C_CONSUL_KEY_PREFIX=some/specific/kv/path \
--env D2C_DRYRUN=true \
jimrazmus/dir2consul:v1.4.1
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Jim Razmus II
This project is licensed under the MIT License - see the LICENSE.md file for details.
Content type
Image
Digest
Size
4.1 MB
Last updated
over 6 years ago
docker pull jimrazmus/dir2consul:v1.4.1