Skip to content

alex-ec2/Baragon

 
 

Repository files navigation

Baragon Build Status

Behold the mighty Baragon's roar

Baragon is a system for automating load balancer configuration updates. It pairs well with the Singularity Mesos framework.

Concept

Baragon is made up of two services:

  • BaragonService -- coordination service

  • BaragonAgentService -- applies changes on the actual load balancer

When a web service changes (i.e. upstreams added / removed), POST a BaragonRequest JSON object to BaragonService's request endpoint. BaragonService will then fan out this change to all affected BaragonAgentServices. Polling the request status url (request/{requestId}) will indicate the current status of the request:

  • WAITING: waiting for request to be applied on all agents
  • SUCCESS: request was successfully applied on all agents
  • FAILED: request was not successfully applied on all agents, and was rolled back
  • CANCELING: request is in the process of being cancelled (rolled back)
  • CANCELED: request was cancelled (rolled back) on all agents
  • UNKNOWN: unknown.

Setup

Prerequisite: A working ZooKeeper cluster.

  1. Build JARs via mvn clean package.

  2. Create a configuration file for the main service. An example lives here. This will be referenced as $SERVICE_CONFIG_YAML.

  3. Create a configuration file for agent service. An example lives here. This will be referenced as $AGENT_CONFIG_YAML.

  4. Copy BaragonService*.jar and $SERVICE_CONFIG_YAML onto one or more hosts, and start the service via java -jar BaragonService-*-SNAPSHOT.jar server $SERVICE_CONFIG_YAML.

  5. Copy BaragonAgentService*.jar and $AGENT_CONFIG_YAML onto each of your load balancer hosts. Start the BaragonAgent service via java -jar BaragonAgentService-*-SNAPSHOT.jar server $AGENT_CONFIG_YAML.

Quickstart with Vagrant

Baragon comes with Vagrant boxes for easy local development and integration testing. Ensure Virtualbox and Vagrant is installed on your machine, and then run vagrant up inside the vagrant folder of the git repo to spin up a Baragon cluster for testing.