Public | Automated Build

Last pushed: 9 months ago
Short Description
Base image for reading kvs from consul
Full Description

docker-alpine-consul

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:

<pre>
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.
</pre>

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.

example:

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.

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

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

Docker Pull Command
Owner
ccfoss
Source Repository

Comments (0)