Wizcorp / frontrunner

Automated HAProxy reconfiguration for Marathon
https://github.com/Wizcorp/frontrunner
MIT License
57 stars 2 forks source link

Frontrunner

Frontrunner is a daemon which triggers a reconfiguration of HAProxy, when an application is modified on Marathon.

It uses node-zookeeper-client to connect to the ZooKeeper cluster used by Marathon and detect changes.

Requirements

* node.js 0.10+

Installation

git clone https://github.com/Wizcorp/frontrunner.git

To install dependencies, run the following command in the created directory:

npm install --production

If you don't plan to use yaml config files, you can use the following:

npm install --production  --no-optional

Configuration

Frontrunner use node-config to manage its configuration files. You can write your configuration files in JavaScript, JSON or YAML.

A default configuration file is provided. It shouldn't be edited.

It contains the following options:

To override some values, you have to create a new file with your environment name.

# config/production.yml

zookeeper:
  connectionString: "192.168.1.1:2181,192.168.1.2:2181,192.168.1.3:2181"
marathon:
  url: "http://192.168.1.1:8080"
proxy:
  haproxy:
    templatePath: "haproxy_custom.cfg"
    reloadCommand: "service haproxy reload"

Usage

To run Frontrunner in the production environment and use the config file, you've just created, run the following:

NODE_ENV=production npm start