Skip to content

Instantly share code, notes, and snippets.

@xynova
Last active August 8, 2017 10:29
Show Gist options
  • Save xynova/9ec436983310738d2d3ab769cc858240 to your computer and use it in GitHub Desktop.
Save xynova/9ec436983310738d2d3ab769cc858240 to your computer and use it in GitHub Desktop.
confd-example-configuration.md

confd-config/confd.toml

confd global configuration (otherwise specified as commandline options)

backend = "redis"
nodes = ["localhost:6379"]
client_key = "<<THE-XXXX-PASSWORD>>"
interval = 10

confd-config/conf.d/my-template-driver.toml

A configuration instructing confd what to query in the backend to drive a specific template. This directory can contain many template drivers.

[template]
src = "my-template.tmpl"
dest = "/etc/nginx/conf.d/default.conf"
owner = "nginx"
mode = "0644"
keys = [
    "/myapp/suggestions/drink"
]
check_cmd = "/usr/sbin/nginx -t -c /etc/nginx/nginx.conf"
reload_cmd = "/usr/sbin/nginx -s reload"

confd-config/templates/my-template.tmpl

The Nginx template driven by the template driver.

server {
    listen       80;
    server_name  localhost;

	location / {
		add_header Content-Type text/plain;
	    return 200 '{{getv "/myapp/suggestions/drink"}}\n';
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment