docker swarm使用笔记

一、创建配置文件

services:
  spider:
    hostname: "{{.Node.Hostname}}"
    image: "newspider_config_py2:v1.0"
    command:
      - -type
      - spider
      - -nums
      - "10"
    deploy:
      replicas: 20
      placement:
        constraints:
          - node.role == worker
          - node.labels.idc == lycc
      mode: "replicated"
      resources:
        limits:
          cpus: "0.2"
          memory: "4096M"
      restart_policy:
        condition: "on-failure"

You May Also Like

About the Author: daidai5771

发表评论

电子邮件地址不会被公开。 必填项已用*标注