Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Docker Swarm scheduling in 1.12

1,736 views

Published on

This presentation talks about different aspects of scheduling in Docker Swarm 1.12

Published in: Software
  • Be the first to comment

Docker Swarm scheduling in 1.12

  1. 1. Docker 1.12 Swarm Scheduling Atharva Chauthaiwale Juniper Networks.
  2. 2. Agenda  Basic Swarm Scheduling Concepts  Scheduling criteria  Resource Awareness  Labels  Constraints  Strategy  Demo  WARNING : We are covering docker 1.12 Swarm mode only !!!
  3. 3. Swarm Scheduler Manager Swarm init Worker 1 swarm join Worker 2 swarm join Worker 3 swarm join Worker 2 swarm join docker service create –-name myredis –-replicas 3 redis:latest Scheduler kicks in Here ! Main job of scheduler is to decide which node to use when running docker container/service. docker service update docker service scale
  4. 4. Scheduling Criteria  Resource Availability  Scheduler is aware of resources available on nodes.  Labels and Constraints  Label : attribute of the node  E.g. environment = test, storage = ssd  Constraints  Restrictions applied by Operator while creating a service.  E.g. docker service create --constraint node.labels.storage==ssd …
  5. 5. Engine Labels & Constraints  Attached to docker Engine  Adding/Modifying requires Docker engine restart  https://docs.docker.com/engine/admin/#/configuring-docker  How to specify Engine labels ( Linux Machine )  Edit file /etc/default/docker modify DOCKER_OPTS and restart daemon  Engine constraints  docker service create --constraint engine.labels.storage==ssd …
  6. 6. Node Labels & Constraints  Can be added by cluster admin for operational purpose  Doesn’t require docker engine restart  docker node update --label-add security=high  docker node update –label-rm security  Node constraints  docker service create --constraint node.labels.deployment.environment != test
  7. 7. Strategy & Affinity  Strategy : What happens when two nodes are similar  Spread strategy : schedule tasks on the least loaded nodes, provided they meet the constraints and resource requirements.  Swarm standalone supported Bean pack and Random strategy NOT SUPPORTED IN SWARM MODE YET !  Affinity and Anti Affinity  Affinity: two containers should be together  Anti Affinity : two containers should not be together  Supported in swarm standalone
  8. 8. Demo  Setup  AWS : 3 EC2 instances – Ubuntu 15.10  1 Manager and 2 workers Manager Worker 1 Worker 2 Engine label: com.storage.class=ssd Engine label: com.storage.class=hdd Engine label: com.storage.class=hdd
  9. 9. References  Swarm mode scheduler : https://github.com/docker/swarmkit/blob/master/README.md  What’s new in Docker 1.12 Scheduling – Docker Captain Ajeet Singh Raina  Docker1.12 and AWS – Atharva  Github repo for the demo - https://github.com/achautha/docker- experiments Thank you !!

×