container orchestration
play

CONTAINER ORCHESTRATION WITH SWARM MODE, MESOS/MARATHON AND - PowerPoint PPT Presentation

CONTAINER ORCHESTRATION WITH SWARM MODE, MESOS/MARATHON AND KUBERNETES ADRIAN MOUAT WHO AM I? Chief Scientist at Container Solutions Wrote "Using Docker" for O'Reilly 40% discount with code AUTHD Docker Captain @adrianmouat WHAT


  1. CONTAINER ORCHESTRATION WITH SWARM MODE, MESOS/MARATHON AND KUBERNETES ADRIAN MOUAT

  2. WHO AM I? Chief Scientist at Container Solutions Wrote "Using Docker" for O'Reilly 40% discount with code AUTHD Docker Captain @adrianmouat

  3. WHAT IS ORCHESTRATION? "The planning or coordination of the elements of a situation to produce a desired effect, especially surreptitiously" Oxford English Dictionary

  4. "The planning or coordination of the elements of a situation to produce a desired effect, especially surreptitiously"

  5. ELEMENTS Containers Hosts Networking

  6. "The planning or coordination of the elements of a situation to produce a desired effect , especially surreptitiously"

  7. DESIRED EFFECT Running application Automatically scale Fault tolerant failover, node rebalancing, health checks Use resources efficiently Little manual intervention

  8. "The planning or coordination of the elements of a situation to produce a desired effect, especially surreptitiously "

  9. SURREPTITIOUSLY "In a way that attempts to avoid notice or attention; secretively" Oxford English Dictionary

  10. SURREPTITIOUSLY Should happen in the background User doesn't need to details Complexity is hidden

  11. HOW IMPORTANT IS ORCHESTRATION? Might not need it for small apps No orchestration == manual orchestration Manually place containers, network, scale, check, update

  12. COMPARING ORCHESTRATORS

  13. COMPARING ORCHESTRATORS All work and are improving rapidly Understand the differences Understand your requirements Please don't roll your own!

  14. THE PLAYERS Kubernetes Mesos Docker Swarm Mode Plus others Nomad, PaaSs...

  15. SIDE NOTE - THE BORG/OMEGA PAPERS Influential papers from Google Lessons learnt from 10 years with containers Both high-level and technical reports Kubernetes, Docker Swarm and Nomad

  16. WELCOME TO THE SOCK SHOP!

  17. MICROSERVICE REFERENCE APPLICATION Intended to help people get started with microservices Great for comparing frameworks etc Similar to "Pet Store" for Java ... or TodoMVC for JavaScript

  18. LOTS OF IMPLEMENTATIONS ALREADY https://github.com/microservices-demo/microservices- demo/tree/master/deploy

  19. ARCHITECTURE

  20. DEMO

  21. DOCKER SWARM MODE

  22. SWARM MODE New in Docker 1.12 Docker Inc's official solution Part of core distribution Major improvement over old Swarm

  23. CORE COMPONENTS Manager nodes coordinate via Raft no need for separate etcd/zookeeper Worker nodes

  24. SNAP TO INSTALL $ docker swarm init Swarm initialized: current node (ejgr3igiwu7mdvescuncyfq19) is now a manager. T o add a worker to this swarm, run the following command: docker swarm join \ --token SWMTKN-1-5cubmn41arycoxa2hk4iu6gmauzafros4vhvnq8ftp0cuacn2u-2jxkuoimbzzoow00wuyxhf1mo \ 10.34.9.126:2377 T o add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.

  25. SECURE COMMS BY DEFAULT TLS set up using self-signed certs Certificates automatically rotated

  26. OTHER FEATURES Spread scheduling chooses "least loaded" node more options later support for reserving & limiting cpu/mem Global or Replica mode "Mesh Networking"

  27. CONSTRAINTS AND FILTERS Control which node a container can be scheduled on E.g: Only nodes labeled "staging" Only nodes which have the image Only the node running a given container

  28. RUNNING SOCK SHOP https://raw.githubusercontent.com/microservices- demo/microservices-demo/master/deploy/swarmkit/start- swarmkit-services.sh (note the repo currently needs updated in-line with version shown in talk)

  29. SWARM MODE ADVANTAGES Snap to install Secure by default Bundled with Docker

  30. SWARM MODE DISADVANTAGES New Some Docker features unsupported DAB still WIP No concept of Pods

  31. MESOS Predates Docker Used by large companies Twitter, Airbnb, eBay ... Mixed load Run Hadoop jobs next to Docker etc

  32. CORE COMPONENTS Containerizer Mesos Agents Mesos Master ZooKeeper Frameworks

  33. CONTAINERIZER Responsible for running isolated process In our case a Docker image Either use Docker or internal runtime

  34. SIDENOTE - CONTAINER RUNTIMES Both Mesos and Kubernetes moving away from Docker Mesos to its own runtime K8s becoming "runtime agnostic" in reality rkt or runc You probably shouldn't care As long as it can run Docker/OCI images Developers will still use Docker

  35. MESOS AGENTS Runs on nodes responsible for executing tasks Submit available resources to master

  36. MESOS MASTER Sends tasks to agents Offers resources to frameworks

  37. ZOOKEEPER Distributed HA database Used primarily for keeping track of current master

  38. FRAMEWORKS Coordinate with master to schedule tasks Multiple frameworks available Can be run together Marathon, Aurora, Chronos, ElasticSearch

  39. RUNNING SOCK SHOP https://raw.githubusercontent.com/microservices- demo/microservices-demo/master/deploy/mesos- marathon/marathon.json

  40. MESOS ADVANTAGES Battle-tested GUI Frameworks

  41. MESOS DISADVANTAGES Needs 3rd party tools networking loadbalancing service discovery Marathon JSON could be cleaner

  42. KUBERNETES

  43. KUBERNETES Based on Google's experience running containers Bakes in various features Load-balancing, secret management More opinionated

  44. CORE CONCEPTS Pods Flat networking space Labels Services Deployments ReplicaSets

  45. PODS Groups of containers deployed and scheduled together Atomic unit Containers in a pod share IP address Single container pods are common Pods are ephemeral

  46. FLAT NETWORKING SPACE All pods are in the same network space Simple cross host communication

  47. LABELS K/V pairs attached to objects (primarily pods) e.g: "version: dev", "tier: frontend" Label selectors then used to identify groups Used for load-balancing etc

  48. SERVICES Stable endpoints addressed by name Forward traffic to pods Pods are selected by labels Round-robin load-balancing Separates endpoint from implementation

  49. DEPLOYMENTS & REPLICASETS ReplicaSets monitor status of Pods start/stop pods as needed Deployments start ReplicaSets Rollout/Rollback & Updates

  50. RUNNING SOCK SHOP https://github.com/microservices-demo/microservices- demo/blob/master/deploy/kubernetes/complete-demo.yaml

  51. KUBERNETES ADVANTAGES Advanced features baked-in Lot of momentum behind the community

  52. KUBERNETES DISADVANTAGES Harder to get started Extra concepts

  53. OTHER CONSIDERATIONS Persistent Data Volumes Secrets Auto-scaling Multi-tenancy Health checks Updates and maintenance Images and platform Federation

  54. CONCLUSIONS Different options with different strengths In some ways surprisingly similar Hard to predict a winner All are much better than rolling-your-own

  55. Swarm Mode Easy to deploy Secure by default WIP Mesos/Marathon Battle-tested Lacks some features Frameworks

  56. Kubernetes Lot of momentum Advanced features

  57. REFERENCES Sock Shop Reference Application TNS Article on Sock Shop Google Papers Large-scale cluster management at Google with Borg (2015) Omega flexible, scalable schedulers for large compute clusters (2013) Borg, Omega, and Kubernetes (2016)

Recommend


More recommend