High-availability scheduling

Last Updated: Apr 01, 2017

To ensure the application have a high availability, the Container service supports the scheduling of the same service in different zones. When a zone malfunctions, the application can still provide services.

You can select the zone in the orchestration file using the environment variables and there are two formats.

  • availability:az==3: The service is distributed in at least three zones. If the current cluster does not have three zones or the machine resources are insufficient for distribution in three zones, creating a container may fail.
  • availability:az==~3: The service is distributed in three zones if possible. If this is not possible, the container can still be created.

The service should be distributed in at least two zones, as shown in the following example.

  1. nnn:
  2. expose:
  3. - 443/tcp
  4. - 80/tcp
  5. image: 'nginx:latest'
  6. environment:
  7. - 'availability:az==2'
  8. labels:
  9. aliyun.scale: '8'
  10. restart: always
  11. volumes:
  12. - /var/cache/nginx
Thank you! We've received your feedback.