Public | Automated Build

Last pushed: 2 years ago
Short Description
Base image for reading kvs from consul
Full Description


Docker base image with alpine and consul-template.

This image is based on consul-template.

Templates need to be created using HCL and placed in /etc/consul.d; exmaple implementation available in ccf-core/kiabana repo.

Using Consul

The following EVs are expected to be passed when using consul:

CONSUL: IP address of consul server or consul agent listening on 8500 port by default.
CUSTOMER_ID: ID of the customer which will be prefixed to all KeyValue pairs stored in consul.

Running Locally

If running locally and consul is not available, then the tempaltes can be created to read from EVs and this image will try to update keys with EVs.


The below example will get CUSTOMER_ID from EV and use that in the key to lookup the service name for elastic search in consul.
If the service name is not found, then it tries to generate the url by using ELASTICSEARCH_URL EV.

{{printf "elasticsearch_%s" (env "CUSTOMER_ID") | key}}
{{range service}}
elasticsearch.url: "http://{{.Name}}.service.consul:{{.Port}}"
elasticsearch.url: "http://{{env "ELASTICSEARCH_URL"}}"

For an example implementation of usage checkout ccf-core/kiabana repo.

Docker Pull Command
Source Repository