Load balancer API
Java JavaScript CSS Other
Clone or download
Latest commit 282b1b2 May 31, 2018
Permalink
Failed to load latest commit information.
BaragonAgentService remove tolower helper May 31, 2018
BaragonClient [maven-release-plugin] prepare for next development iteration Apr 18, 2018
BaragonCore Workaround for https://issues.apache.org/jira/browse/EXEC-62 Apr 23, 2018
BaragonData [maven-release-plugin] prepare for next development iteration Apr 18, 2018
BaragonService [maven-release-plugin] prepare for next development iteration Apr 18, 2018
BaragonServiceIntegrationTests [maven-release-plugin] prepare for next development iteration Apr 18, 2018
BaragonUI [maven-release-plugin] prepare for next development iteration Apr 18, 2018
BaragonWatcher [maven-release-plugin] prepare for next development iteration Apr 18, 2018
Docs Fix h4 headings Feb 6, 2018
cookbook Point to current baragon-cookbook repo Aug 31, 2015
docker work agent and service with mvn and compose Jul 10, 2015
.blazar-enabled Enable Blazar Sep 25, 2017
.blazar.yaml Bump versions in blazar yamls for snapshots Feb 27, 2018
.bookignore additions to bookignore May 20, 2016
.gitignore gitbook-ify baragon May 20, 2016
.hubspot-blazar-discovery.yaml Enable Blazar Sep 25, 2017
.travis.yml Java-8-ify Baragon Jan 30, 2017
CHANGES.md add changelog file Aug 25, 2014
Dockerfile Install latest nginx Oct 23, 2015
Dockerfile-aurora Install latest nginx Oct 23, 2015
LICENSE Create LICENSE Jan 14, 2014
README.md Update README.md Mar 6, 2018
SUMMARY.md gitbook-ify baragon May 20, 2016
book.json gitbook-ify baragon May 20, 2016
compose-dev.yml WIP BaragonUI -> react Feb 6, 2017
dev switch completely to docker based dev workflow Aug 31, 2015
docker-compose.yml update compose yaml for new release Mar 19, 2018
docker_release.sh update docker release script Feb 28, 2018
intro.md gitbook-ify baragon May 20, 2016
pom.xml [maven-release-plugin] prepare for next development iteration Apr 18, 2018
publish_gitbook.sh file perms May 20, 2016

README.md

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.

Contents

Baragon Basics

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 /[contextPath]/request endpoint like this one:

{
  "loadBalancerRequestId": "4",
  "loadBalancerService": {
    "serviceId": "1",
    "owners": ["foo"],
    "serviceBasePath": "/basepath",
    "loadBalancerGroups": ["loadBalancerGroupName"]
  },
  "addUpstreams": ["1.1.1.1:80"],
  "removeUpstreams": []
}
  • BaragonService will fan out the update to all BaragonAgents in the specified loadBalancerGroups
  • BaragonAgents will apply the changes on the load balancer using templates provided in its configuration and report back a Success or Failure to BaragonService
  • Polling the BaragonService request status url (/[contextPath]/request/{loadBalancerRequestId}) will indicate the current status of the request

Check out the API Docs for additional BaragonRequest fields and returned values.

Getting Started

For more details on configuring and using Baragon, check out the detailed setup and management guide

** Prerequisite: A working ZooKeeper cluster **

  1. Build JARs via mvn clean package.

  2. Create a configuration file for Baragon Service and Baragon Agent. These are an extended version of a Dropwizard configuration file. Details on configurable fields can be found in the example configs below and in the detailed setup and management guide

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

  2. Copy BaragonAgentService-*-SNAPSHOT.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 Docker Compose

To get an example cluster up and running, you can install docker and docker-compose.

Simply run docker-compose up to bring up:

  • zookeper container
  • Baragon Service container
  • Two Baragon Agent + Nginx containers

The Baragon UI will be available at localhost:8080 and nginx at localhost:80.

If using boot2docker replace localhost with the boot2docker ip

Nginx's config directories that BaragonAgent writes to will also be mounted as volumes in the docker/configs folder on your local machine.

BaragonUI

Baragon comes with a UI for visualization and easier management of load balancer paths and upstreams. By default it will be available in a read-only mode at /[contextPath]/ui see the Example Baragon Service Configuration or detailed setup and management guide for more details on configuring BaragonUI behavior.

Baragon API Docs

Full documentation on the Baragon Service API can be found here