-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.conf
143 lines (123 loc) · 6.75 KB
/
config.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
// This denotes the start of the configuration section for Consul. All values
// contained in this section pertain to Consul.
consul {
// This is the address of the Consul agent. By default, this is
// 127.0.0.1:8500, which is the default bind and port for a local Consul
// agent. It is not recommended that you communicate directly with a Consul
// server, and instead communicate with the local Consul agent. There are many
// reasons for this, most importantly the Consul agent is able to multiplex
// connections to the Consul server and reduce the number of open HTTP
// connections. Additionally, it provides a "well-known" IP address for which
// clients can connect.
address = "consul.service.bcn1.sdisc.odigeo.com:8500"
// This is the ACL token to use when connecting to Consul. If you did not
// enable ACLs on your Consul cluster, you do not need to set this option.
//
// This option is also available via the environment variable CONSUL_TOKEN.
//token = "abcd1234"
// This controls the retry behavior when an error is returned fro Consul.
// Consul Template is highly fault tolerant, meaning it does not exit in the
// face of failure. Instead, it uses exponential back-off and retry functions
// to wait for the cluster to become available, as is customary in distributed
// systems.
retry {
// This enabled retries. Retries are enabled by default, so this is
// redundant.
enabled = true
// This specifies the number of attempts to make before giving up. Each
// attempt adds the exponential backoff sleep time. Setting this to a
// negative number will implement an unlimited number of retries.
attempts = 5
// This is the base amount of time to sleep between retry attempts. Each
// retry sleeps for an exponent of 2 longer than this base. For 5 retries,
// the sleep times would be: 250ms, 500ms, 1s, 2s, then 4s.
backoff = "250ms"
}
// This block configures the SSL options for connecting to the Consul server.
}
// This block defines the configuration for exec mode. Please see the exec mode
// documentation at the bottom of this README for more information on how exec
// mode operates and the caveats of this mode.
exec {
// This is the command to exec as a child process. There can be only one
// command per Consul Template process.
command = "./run.sh"
// This is a random splay to wait before killing the command. The default
// value is 0 (no wait), but large clusters should consider setting a splay
// value to prevent all child processes from reloading at the same time when
// data changes occur. When this value is set to non-zero, Consul Template
// will wait a random period of time up to the splay value before reloading
// or killing the child process. This can be used to prevent the thundering
// herd problem on applications that do not gracefully reload.
splay = "5s"
// This defines the signal that will be sent to the child process when a
// change occurs in a watched template. The signal will only be sent after the
// process is started, and the process will only be started after all
// dependent templates have been rendered at least once. The default value is
// nil, which tells Consul Template to stop the child process and spawn a new
// one instead of sending it a signal. This is useful for legacy applications
// or applications that cannot properly reload their configuration without a
// full reload.
reload_signal = "SIGHUP"
// This defines the signal sent to the child process when Consul Template is
// gracefully shutting down. The application should begin a graceful cleanup.
// If the application does not terminate before the `kill_timeout`, it will
// be terminated (effectively "kill -9"). The default value is "SIGTERM".
kill_signal = "SIGTERM"
// This defines the amount of time to wait for the child process to gracefully
// terminate when Consul Template exits. After this specified time, the child
// process will be force-killed (effectively "kill -9"). The default value is
// "30s".
kill_timeout = "30s"
}
// This block defines the configuration for a template. Unlike other blocks,
// this block may be specified multiple times to configure multiple templates.
// It is also possible to configure templates via the CLI directly.
template {
// This is the source file on disk to use as the input template. This is often
// called the "Consul Template template". This option is required if not using
// the `contents` option.
source = "/haproxy.cfg.ctmpl"
// This is the destination path on disk where the source template will render.
// If the parent directories do not exist, Consul Template will attempt to
// create them.
destination = "haproxy.cfg"
// This option allows embedding the contents of a template in the configuration
// file rather then supplying the `source` path to the template file. This is
// useful for short templates. This option is mutually exclusive with the
// `source` option.
//contents = "{{ keyOrDefault \"service/redis/maxconns@east-aws\" \"5\" }}"
// This is the optional command to run when the template is rendered. The
// command will only run if the resulting template changes. The command must
// return within 30s (configurable), and it must have a successful exit code.
// Consul Template is not a replacement for a process monitor or init system.
//command = "restart service foo"
// This is the maximum amount of time to wait for the optional command to
// return. Default is 30s.
command_timeout = "60s"
// This is the permission to render the file. If this option is left
// unspecified, Consul Template will attempt to match the permissions of the
// file that already exists at the destination path. If no file exists at that
// path, the permissions are 0644.
perms = 0644
// This option backs up the previously rendered template at the destination
// path before writing a new one. It keeps exactly one backup. This option is
// useful for preventing accidental changes to the data without having a
// rollback strategy.
backup = true
// These are the delimiters to use in the template. The default is "{{" and
// "}}", but for some templates, it may be easier to use a different delimiter
// that does not conflict with the output file itself.
left_delimiter = "{{"
right_delimiter = "}}"
// This is the `minimum(:maximum)` to wait before rendering a new template to
// disk and triggering a command, separated by a colon (`:`). If the optional
// maximum value is omitted, it is assumed to be 4x the required minimum value.
// This is a numeric time with a unit suffix ("5s"). There is no default value.
// The wait value for a template takes precedence over any globally-configured
// wait.
wait {
min = "2s"
max = "10s"
}
}