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 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]

210 views

Published on

These presentation is about the features brought by the new Docker 1.12, and mostly the new Swarm Mode.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Docker 1.12 & Swarm Mode [Montreal Docker Meetup Sept. 2016]

  1. 1. CleverToday Docker 1.12 & the new Swarm mode
  2. 2. CleverToday Agenda • Swarm Mode • Setup • Overlay Network • Service Discovery • Load Balancing • Other new features…
  3. 3. CleverToday Swarm Mode
  4. 4. CleverToday Basic cluster Swarm Master Swarm Node
  5. 5. CleverToday
  6. 6. CleverToday Create a cluster: Before $ CLUSTER_ID=`docker run --rm swarm create` $ docker run -t -p <swarm_port>:2375 swarm manage token://$CLUSTER_ID $ docker run -d swarm join --addr=<node_ip:2375> token://$CLUSTER_ID $ docker run --rm swarm list token://$CLUSTER_ID
  7. 7. CleverToday $ docker swarm join --token <token> <manager>:2377 Create a cluster: Now $ docker swarm init
  8. 8. CleverToday Create a cluster: Now $ docker node ls $ docker swarm join-token
  9. 9. CleverToday Overlay network Swarm Master Swarm Node mynet (overlay network) | | | | | | | | | | | | | | |
  10. 10. CleverToday Overlay network: Before Swarm Master Swarm Node mynet (overlay network) Key / Value Store | | | | | | | | | | | | | | |
  11. 11. CleverToday Overlay network: Now $ docker service create --replicas 4 --name web --network mynet --publish 80:80/tcp nginx:latest mynet (overlay network) | | | | | | | | | | | |
  12. 12. CleverToday Overlay network: Now mynet (overlay network) | | | | | | | | | | | | | | | $ docker service scale web=5
  13. 13. CleverToday Node Failure: Before mynet (overlay network) | | | | | | | | | | | | | | | $ docker run -d -e reschedule:on-node-failure redis
  14. 14. CleverToday Node Failure: Before mynet (overlay network) | | | | | | | | | | | | | | | $ docker run -d -e reschedule:on-node-failure redis
  15. 15. CleverToday Node Failure: Now mynet (overlay network) | | | | | | | | | | | | | | | $ docker service create --replicas 6 --name redis --network mynet redis:latest | | |
  16. 16. CleverToday Node Failure: Now mynet | | | | | | | | | | | | Desired State = 6 instances Actual State = 4 instances Desired State != Actual State
  17. 17. CleverToday Node Failure: Now mynet | | | | | | | | | | | | Desired State = 5 instances Actual State = 4 instances Desired State != Actual State | | | | | |
  18. 18. CleverToday Service Discovery
  19. 19. CleverToday Service Discovery: Before
  20. 20. CleverToday Service Discovery: Before
  21. 21. CleverToday Overlay Network Service Discovery: Now DNS web: 1.1.1.1 nodeapp: 1.1.1.2 IPVS 1.1.1.2 IPVS 1.1.1.1 10.0.0.1 10.0.0.2 10.0.0.310.0.0.4 $ docker service create --name web --network mynet mynginx:latest $ docker service create --replicas 3 --name nodeapp --network mynet nodeapp:latest
  22. 22. CleverToday Overlay Network Service Discovery: Now DNS web: 1.1.1.1 nodeapp: 1.1.1.2 IPVS 1.1.1.2 IPVS 1.1.1.1 nodeapp? 10.0.0.1 10.0.0.2 10.0.0.310.0.0.4
  23. 23. CleverToday Overlay Network Service Discovery: Now DNS web: 1.1.1.1 nodeapp: 1.1.1.2 IPVS 1.1.1.2 IPVS 1.1.1.1 10.0.0.1 10.0.0.2 10.0.0.310.0.0.4
  24. 24. CleverToday Ingress Load-Balancer mynet | | | | | | | | | | | | $ docker service create --name web --network mynet --published 80:80/tcp web:latest $ docker service create --replicas 3 --name nodeapp --network mynet nodeapp:latest :80
  25. 25. CleverToday Ingress Load-Balancer mynet | | | | | | | | | | | | $ docker service create --name web --network mynet --published 80:80/tcp web:latest $ docker service create --replicas 3 --name nodeapp --network mynet nodeapp:latest :80
  26. 26. CleverToday Ingress Load-Balancer mynet | | | | | | | | | | | | $ docker service create --name web --network mynet --published 80:80/tcp web:latest $ docker service create --replicas 3 --name nodeapp --network mynet nodeapp:latest :80
  27. 27. CleverToday Ingress Load-Balancer mynet | | | | | | | | | | | | $ docker service create --name web --network mynet --published 80:80/tcp web:latest $ docker service create --replicas 3 --name nodeapp --network mynet nodeapp:latest :80 :80 :80 :80 External LB
  28. 28. CleverToday Ingress Load-Balancer mynet | | | | | | | | || | | $ docker service create --name web --network mynet --published 80:80/tcp web:latest $ docker service create --replicas 3 --name nodeapp --network mynet nodeapp:latest :80 :80 :80
  29. 29. CleverToday Ingress Load-Balancer | | | | | || | | $ docker service create --name web --network mynet --published 80:80/tcp web:latest $ docker service create --replicas 3 --name nodeapp --network mynet nodeapp:latest :80 :80 | | |
  30. 30. CleverToday What else?
  31. 31. CleverToday Container Health Check • Dockerfile example: Checks every 5 min that web server can return index page within 3 sec FROM bargenson/nginx:1.9 COPY nginx.conf /etc/nginx/nginx.conf HEALTCHECK --interval=5m --timeout=3s --retries 3 CMD curl -f http://localhost || exit 1
  32. 32. CleverToday Plugins (experimental) • New plugin command to manage plugins with install, enable, disable, ls, rm, inspect and set subcommands • New Plugin Permissions Model
  33. 33. CleverToday Distributed Application Bundle (experimental) • Docker Compose allows you to define a file to configure your application containers • Distributed Application Bundles (.dab) define a file to configure your application services stack • Can be build from the docker-compose.yml used by your development team: $ docker-compose bundle • To deploy a bundle: $ docker deploy myapp-stack • To manage you stacks: $ docker stack <COMMAND>
  34. 34. CleverToday For more… https://github.com/docker/docker/blob/master/CHANGELOG.md
  35. 35. CleverToday brice@clevertoday.com @bargenson

×