docker service is the new docker run
play

docker service is the new docker run Getting Started with Docker - PowerPoint PPT Presentation

docker service is the new docker run Getting Started with Docker Clustering Mike Goelzer / mgoelzer@docker.com / @mgoelzer Docker Inc. docker service is the new docker run docker run nginx 2013-14 docker run -p 3375:2375 swarm ; 2014-15


  1. docker service is the new docker run Getting Started with Docker Clustering Mike Goelzer / mgoelzer@docker.com / @mgoelzer Docker Inc.

  2. docker service is the new docker run docker run nginx 2013-14 docker run -p 3375:2375 swarm ; 2014-15 docker run -H :3375 nginx Swarm Mode in Docker Engine docker swarm init ; 2016 docker service create nginx

  3. Features Walkthrough

  4. Swarm Mode Engine $ docker swarm init

  5. Swarm Mode Engine Engine $ docker swarm init $ docker swarm join <IP of manager>:2377

  6. Swarm Mode Engine Engine Engine Engine Engine Engine $ docker swarm init $ docker swarm join <IP of manager>:2377

  7. Services Engine Engine Engine mynet Engine Engine Engine $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend:latest

  8. Services Engine Engine Engine mynet Engine Engine Engine $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend:latest $ docker service create --name redis --network mynet redis:latest

  9. Node Failure Engine Engine Engine mynet Engine Engine Engine $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend:latest $ docker service create --name redis --network mynet redis:latest

  10. Node Failure Engine Engine Engine mynet Engine Engine Engine $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend:latest $ docker service create --name redis --network mynet redis:latest

  11. Desired State ≠ Actual State Engine Engine Engine mynet Engine Engine $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend:latest $ docker service create --name redis --network mynet redis:latest

  12. Converge Back to Desired State mynet Engine Engine Engine Engine Engine $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend:latest $ docker service create --name redis --network mynet redis:latest

  13. Scaling mynet Engine Engine Engine Engine Engine $ docker service update --replicas 6 frontend

  14. Scaling mynet Engine Engine Engine Engine Engine $ docker service update --replicas 10 frontend

  15. Global Services mynet Engine Engine Engine Engine Engine $ docker service create --mode=global --name prometheus prom/prometheus

  16. Constraints docker daemon --label Engine com.example.storage="ssd" Engine Engine Engine docker daemon --label Engine Engine com.example.storage="ssd"

  17. Constraints Engine docker daemon --label com.example.storage="ssd" Engine Engine Engine docker daemon --label Engine Engine com.example.storage="ssd" $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 --constraint engine.labels.com.example.storage==ssd frontend:latest

  18. Constraints Engine docker daemon --label com.example.storage="ssd" Engine Engine Engine docker daemon --label Engine Engine com.example.storage="ssd" $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 --constraint engine.labels.com.example.storage==ssd frontend:latest $ docker service update --replicas 10 frontend

  19. Container Health Check in Dockerfile HEALTHCHECK --interval=5m --timeout=3s --retries 3 CMD curl -f http://localhost/ || exit 1 Check web server every 5 minutes, require < 3 sec latency. >= 3 consecutive failures sets unhealthy state Coming soon: health checks in official images

  20. Routing Mesh User accesses • Operator reserves a myapp.com:8080 swarm-wide ingress port (8080) for myapp • Every node listens on 8080 • Container-aware routing mesh can transparently reroute :8080 :8080 :8080 traffic from Worker3 to a node that is running container • Built in load balancing into the Engine frontend frontend frontend • DNS-based service discovery $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend:latest

  21. Routing Mesh: Published Ports User accesses • Operator reserves a myapp.com:8080 swarm-wide ingress port (8080) for myapp • Every node listens on 8080 • Container-aware routing mesh can transparently reroute :8080 :8080 :8080 traffic from third node to a node that is running container • Built in load balancing into the Engine frontend frontend frontend • DNS-based service discovery $ docker service create --replicas 3 --name frontend --network mynet -p 8080:80 frontend_image:latest

  22. Secure by default with end-to-end encryption • Out-of-the-box TLS encryption and mutual auth TLS TLS TLS • Automatic cert rotation • External or self-signed Certificate Certificate Certificate Authority Authority Authority root CA • Cryptographic node identity TLS TLS TLS

  23. Scale: 2,000 Nodes and Counting For now: community testing, crowd-sourced nodes, not funded by ● Docker Credit to: Chanwit Kaewkasi, Suranaree University of ● Technology (SUT), Thailand Results: ● ○ 2,384 nodes @chanwit ○ 96,287 containers ○ Manager CPU/memory ≲ 15% ○ Test stopped because 3rd-party monitoring failed https://github.com/swarm2k/swarm2k ●

  24. Deep Dive: Topology

  25. Topology Node Node Node Node Node Node Node Node Node Node Node Node

  26. Topology: roles Node Node Node Node Node Node Node Node Node Node Node Node Manager Worker

  27. Topology: roles Node ● Each Node has a role ● Roles are dynamic Node ● Programmable Topology Node Node Node Node Node Node Node Node Node Node Manager Worker

  28. Topology: scaling model Manager Manager Manager Worker Worker Worker Worker Worker Worker

  29. Topology: High Availability Follower Leader Follower Manager Manager Manager Worker Worker Worker Worker Worker Worker

  30. Topology: High Availability Follower Leader Follower Manager Manager Manager Worker Worker Worker Worker Worker Worker

  31. Topology: High Availability Leader Follower Follower Manager Manager Manager Worker Worker Worker Worker Worker Worker

  32. Topology: High Availability Leader Follower Follower Manager Manager Manager Worker Worker Worker Worker Worker Worker

  33. DEMO

  34. Victor Vieux Mike Goelzer vieux@docker.com / @vieux mgoelzer@docker.com / @mgoelzer

Recommend


More recommend