Skip to content

Scalers

Maximilien Richer edited this page Aug 24, 2016 · 5 revisions

A scaler define how a specific service will be updated and can be used by multiple rules. Available backends for scalers are docker-compose and docker-service.

docker-compose

The docker-compose scaler use the scale command of docker-compose. As docker-compose don't expose any API, actions are performed by building and execution a raw command.

Requirements

You must have docker-compose in your path.

Example

scalers:
  scaler-custom-name:
    type: "docker-compose-cmd"
    # project: usually the name of the folder your started compose into
    project: "traefik"
    # target: service to scale as named in the compose file
    target: "whoami"
    # config: path to the config file
    config: "docker-compose.yaml"
    upper_count_limit: 0 # default, 0 mean unlimited
    lower_count_limit: 1 # default

docker-service

Docker 1.12 introduce swarm mode and services. Services are managed by docker and can be scaled using the API.

docker service create --replicas 1 --name helloworld alpine ping docker.com

Requirements

Docker daemon 1.12.

Example

scalers:
  scaler-custom-name:
    type: "docker-service"
    service: "helloworld"
    upper_count_limit: 0 # default, 0 mean unlimited
    lower_count_limit: 1 # default
Clone this wiki locally