Home

Awesome

Zoidberg

Zoidberg provides per app service discovery for Mesos with pluggable discovery mechanisms. It allows you to shift traffic from version to version in small percentages to ensure smooth deployments. It also allows usual service discovery where it's up to framework how to schedule tasks to avoid downtime.

Compatible load balancers

Stability

Even though Zoidberg is deployed at scale (think 100s of Mesos slaves), it is still stabilizing. Please see release notes before upgrading.

Architecture

Zoidberg consists of several parts:

It is possible to run several independent Zoidberg instances on a single cluster. Each Zoidberg instance is only responsible for making sure that his group of load balancers knows about current state of application. Different Zoidberg instances can manage a single or completely independent groups of load balancers.

Finders

Finder is a mechanism to discover load balancers and application tasks.

Application finders

Application finders discover apps running on your cluster.

The following application finders are available:

You must specify application finder with -application-finder cli argument.

Mesos and Marathon finders

Both marathon and mesos finders are label based finders, which means that they rely on labels to discover applications running on the cluster.

Make sure to use the following labels for your apps:

Here X is the port index. Each port creates a separate app so you can expose them through different load balancers.

Arguments for marathon finder:

Arguments for mesos finder:

Load balancer finders

Load balancer finders discover load balancers available on your cluster.

The following load balancer finders are available:

You must specify load balancer finder with -balancer-finder cli argument.

Static finder

static finder has a predefined list of applications.

Arguments:

Mesos and Marathon finders

Both marathon and mesos finders are label based finders, which means that they rely on labels to discover balancers available on the cluster.

Make sure to use the following labels for your apps that are load balancers:

Arguments for marathon finder:

Arguments for mesos finder:

Running

In addition to finder arguments, you also have to specify the following:

Note that instead of cli arguments you can also use environment variables, just drop the first -, replace and - with _ and capitalize argument name. For example, instead of specifying -application-finder marathon you could set environment variable APPLICATION_FINDER=marathon.

Zoidberg is distributed as a docker image, below is an example how to run it against Marathon running on a local Mesos cluster. Ttake a look at mesos-compose to find out more about running local mesos cluster.

docker run --rm -it --net host \
    -e HOST=0.0.0.0 \
    -e PORT=12345 \
    -e ZK=127.0.0.1:2181/zoidberg \
    -e APPLICATION_FINDER=marathon \
    -e APPLICATION_FINDER_MARATHON_URL=http://172.16.91.128:8080 \
    -e APPLICATION_FINDER_MARATHON_BALANCER=local \
    -e BALANCER_FINDER=static \
    -e BALANCER_FINDER_STATIC_BALANCERS=127.0.0.1:1234 \
    bobrik/zoidberg:0.6.0

Zoidberg API

Zoidberg provides the next HTTP API:

{
  "1": {
    "weight": 2
  }
}

{{app}} in URL should be replaced with the name of an actual app.

{
  "balancers": [
    {
      "host": "192.168.0.7",
      "port": 31631
    }
  ],
  "apps": {
    "myapp": {
      "name": "myapp",
      "servers": [
        {
          "host": "192.168.0.7",
          "port": 31000,
          "ports": [31000],
          "version": "1"
        }
      ],
      "meta": {}
    }
  }
}

Why?

zoidberg