edit-icon download-icon

global

Last Updated: Feb 12, 2018

Template version

Compose V1/V2 Compose V3
The aliyun.global label. mode in Compose.

Compose V1/V2

Set the service as a global service.

Some services need to be deployed to every node, such as monitoring and logging services. When a node is created, a container is deployed to the node.

A service is deployed to each node of the cluster if the service is set as global. When a node is created or added in the cluster, a container is automatically deployed to the node.

Orchestration example:

  1. monitor:
  2. image: sample
  3. labels:
  4. aliyun.global: true

Compose V3

This function is equivalent to the Global Service (see the following section mode) in swarm mode. When a node is added to the cluster, the corresponding container will be automatically created on that node.

Orchestration example:

  1. version: '3'
  2. services:
  3. worker:
  4. image: dockersamples/examplevotingapp_worker
  5. deploy:
  6. mode: global

mode

The mode can be configured as Global (one container on each node) or Replicated (specified number of containers). Replicated is configured by default.

  1. version: '3'
  2. services:
  3. worker:
  4. image: dockersamples/examplevotingapp_worker
  5. deploy:
  6. mode: replicated
  7. replicas: 6
Thank you! We've received your feedback.