Orbiter is an opensource docker swarm autoscaler
Go to file
Gianluca Arbezzano be8f301328 Add basic commands to help with debugging
Add new API call to get all the autoscalers currently managed by
orbiter:

```
curl http://localhost:8000/autoscaler
```

Add command into the CLI to get this list

```
export ORBITER_HOST=http://localhost:8000 orbiter autoscler ls
```

Add command into the CLI to print all the events fired by the daemon:

```
export ORBITER_HOST=http://localhost:8000 orbiter system events
```
2017-03-18 19:49:17 +00:00
api Add basic commands to help with debugging 2017-03-18 19:49:17 +00:00
autoscaler Add basic commands to help with debugging 2017-03-18 19:49:17 +00:00
cmd Add basic commands to help with debugging 2017-03-18 19:49:17 +00:00
core Fixed tests 2017-03-15 21:56:58 +00:00
provider Add basic commands to help with debugging 2017-03-18 19:49:17 +00:00
utils/hook Event stream 2017-02-24 00:16:28 +00:00
vendor Update digitalocean/godo 2017-03-16 23:09:14 +00:00
.gitignore
.travis.yml Fixed travis deploy script 2017-03-17 18:39:59 +00:00
Dockerfile Use docker scratch image 2017-03-17 18:52:58 +00:00
LICENSE Apache 2 licence 2017-02-21 10:03:18 +00:00
lock.json Update digitalocean/godo 2017-03-16 23:09:14 +00:00
main.go Add basic commands to help with debugging 2017-03-18 19:49:17 +00:00
Makefile Add support to build gianarb/orbiter docker image 2017-03-12 23:49:51 +00:00
manifest.json
README.md Add support to build gianarb/orbiter docker image 2017-03-12 23:49:51 +00:00

Build
Status

Public and private cloud or different technologies like virtual machine or containers. Our applications and our environments require to be resilient doesn't matter where they are or which services are you using.

This project is a work in progress cross platform open source autoscaler.

We designed in collaboration with InfluxData to show how metrics can be used.

It is based on plugins called provider. At the moment we implemented:

  • Docker Swarm mode
  • DigitalOcean
orbiter daemon -config config.yml

Orbiter is a daemon that use a YAML configuration file to starts one or more autoscaler and it exposes an HTTP API to trigger scaling up or down.

autoscalers:
  events:
    provider: swarm
    parameters:
    policies:
      php:
        up: 4
        down: 3
  infra_scale:
    provider: digitalocean
    parameters:
      token: zerbzrbzrtnxrtnx
      region: nyc3
      size: 512mb
      image: ubuntu-14-04-x64
      key_id: 163422
      # https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting
      userdata: |
        #cloud-config

        runcmd:
          - sudo apt-get update
          - wget -qO- https://get.docker.com/ | sh        
    policies:
      frontend:
        up: 2
        down: 3

This is an example of configuration file. Right now we are creating two autoscalers one to deal with swarm called events/php and the second one with DigitalOcean called infra_scale.

Vocabulary

  • provider contains integration with the platform to scale. It can be swarm, DigitalOcean, OpenStack, AWS.
  • Every autoscaler supports a k\v storage of parameters that you can use to configure your provider.
  • autoscaler` is composed by provider, parameters and policies. You can have one or more.
  • autoscaler has only or more policies they contains information about a specific application.

You can have only one autoscaler or more with th same provider. Same for policies, only one or more. Doesn't matter.

Http API

Orbiter exposes an HTTP JSON api that you can use to trigger scaling UP (true) or DOWN (false).

The concept is very simple, when your monitoring system knows that it's time to scale it can call the outscaler to persist the right action

curl -v -d '{"direction": true}' \
    http://localhost:8000/handle/infra_scale/docker

Embeddable

This project is trying to provide also an easy API to maintain a lot complexy and clean code base in order to allow you to use orbiter as project for your applications. OpenStack, Kubernets all of them have a sort of autoscaling feature that you can use. The idea is to keep this complexy out of your deployment tools. You can just implement orbiter. Another use case is a self-deployed application. Kelsey Hightower had a talk about this idea. I am still not sure that can be real in those terms but we are already moving something in our applications that before was in external system as monitoring, healthcheck why not the deployment part?

package scalingallthethings

import (
	"github.com/gianarb/orbiter/autoscaler"
	"github.com/gianarb/orbiter/provider"
)

func CreateAutoScaler() *autoscaler.Autoscaler{
    p, _ := provider.NewProvider("swarm", map[string]string{})
    a, _ := autoscaler.NewAutoscaler(p, "name-service", 4, 3)
    return a
}

With docker

docker run -it -v ${PWD}/your.yml:/etc/orbiter.yml -p 8000:8000 gianarb/orbiter

We are supporting an imag gianarb/orbiter in hub.docker.com. You can run it with your configuration.

In this example I am using volumes but if you have a Docker Swarm 1.13 up and running you can use secrets.