|esell ba399c4f37 add sample restart script||3 years ago|
|src/github.com/radiantiq/conf-builder||3 years ago|
|.gitignore||3 years ago|
|LICENSE.txt||3 years ago|
|README.md||3 years ago|
|conf.json||3 years ago|
|sample-reload-script.sh||3 years ago|
Builds out the HAproxy config file based on data in consul. Whenever a service change is detected a new config is created and HAproxy is reloaded.
Conf-builder currently uses gb to build although no outside libraries are needed:
go get github.com/constabulary/gb/... git clone https://github.com/radiantiq/conf-builder.git cd conf-builder gb test gb build
Place the conf.json file in the same directory as the executable and run it, that’s about it. The configurable values are:
The expected consul layout would look like:
/v1/kv/consulConfigPath ├── backend │ └── myApp │ ├── balance = balancer type (roundrobin, etc) │ ├── catalogMapping = consul service name │ ├── mode = proxy type (tcp, http, etc) │ ├── staticConf = any static config you'd like to add │ └── type = dynamic/static member updates ├── defaults = defaults section of the HAProxy config ├── frontend │ └── myApp │ ├── bindOptions = any additional bind options to add (SSL, etc) │ ├── listenPort port for HAProxy to listen on │ ├── mode = proxy type (tcp, http, etc) │ └── staticConf = any static config you'd like to add └── global = global section of the HAproxy config
myApp is the name you want to use for your VIP. You do not have to have a frontend AND a backend, you can just use one or the other if you’d like and of course you can have multiples (
yetAnother, etc) as long as they follow the layout.