ContainerDayVietnam2016: Docker at scale with Mesos

  • Published on
    20-Mar-2017

  • View
    184

  • Download
    4

Embed Size (px)

Transcript

<ul><li><p>Docker at scale with Mesos</p><p>Phm Tun Anh Lead engineer @ VCCloud Platform Services</p></li><li><p>$ whoami</p><p> Lead engineer at VCCloud Platform Services </p><p> Build &amp; work with large-scale/production platform services for about 6 years </p><p> Services: Storage, DNS, CDN, DDoS Protection, Logging, Private PaaS</p></li><li><p>Agenda</p><p>1. What is Mesos? </p><p>2. How to run docker containers on Mesos </p><p>3. Lessons learned </p><p>4. Q&amp;A</p></li><li><p>1. What is Mesos?</p><p>2. How to run docker containers on Mesos </p><p>3. Lessons learned </p><p>4. Q&amp;A</p></li><li><p>https://blog.twitter.com/2016/overview-of-the-twitter-cloud-platform-compute</p><p>https://blog.twitter.com/2016/overview-of-the-twitter-cloud-platform-compute</p></li><li><p>https://mesosphere.com/blog/2015/04/23/apple-details-j-a-r-v-i-s-the-mesos-framework-that-runs-siri/</p><p>https://mesosphere.com/blog/2015/04/23/apple-details-j-a-r-v-i-s-the-mesos-framework-that-runs-siri/</p></li><li><p>Powered by Mesos: Apple </p><p> Atlassian </p><p> CERN </p><p> Cisco </p><p> Cloudflare </p><p> Foursquare </p><p> Groupon</p><p> HubSpot </p><p> Netflix </p><p> Opera </p><p> Paypal </p><p> Shopee </p><p> Shopify </p><p> Saleforce</p><p> Twitter </p><p> Uber </p><p> Vimeo </p><p> Verizon </p><p> Weibo </p><p> Yelp </p><p> Xiaomi</p><p>http://mesos.apache.org/documentation/latest/powered-by-mesos/</p><p>http://mesos.apache.org/documentation/latest/powered-by-mesos/</p></li><li><p>Solomon Hykes, Founder &amp; CTO of Docker, said at DockerCon EU 12/2014: </p><p>Mesos is the gold standard for large-scale production clusters running containers</p></li><li><p>Mesos is:</p><p> Open source, top-level Apache project </p><p> Proven at massive scale </p><p> Multi-resource (CPU, RAM, Disk, GPU) scheduling </p><p> Simplified operational model </p><p> Cross platform </p><p> Native Docker support</p></li><li><p> PaaS: Marathon, Aurora, Kubernetes, Swarm </p><p> Big Data: Hadoop, Spark, Storm </p><p> Database: Cassandra, ArangoDB, </p><p> ElasticSearch, Chronos, Jenkins, Kafka</p><p>Mesos Frameworks:</p></li><li><p>1. What is Mesos? </p><p>2. How to run docker containers on Mesos</p><p>3. Lessons learned </p><p>4. Q&amp;A</p></li><li><p> Apache Aurora</p><p> Google Kubernetes</p><p> HubSpot Singularity </p><p> Mesosphere Marathon</p></li><li><p>Features:</p><p> Start, stop, scale, update, rollback apps </p><p> Rolling deploy / restart </p><p> Constraints </p><p> Health checks </p><p> App dependencies </p><p> Highly available, no SPoF</p></li><li><p>1. What is Mesos? </p><p>2. How to run docker containers on mesos </p><p>3. Lessons learned</p><p>4. Q&amp;A</p></li><li><p> Immutable Infrastructure / CodeShip</p><p>Some of the major challenges today when building infrastructure are predictability, scalability and automated recovery. </p></li><li><p> Container style</p><p> Service discovery </p><p> Networking</p><p>Lessons Learned</p><p> Managing secrets </p><p> App deployment </p><p> Docker annoyances</p></li><li><p>Choose a container style:</p><p> "thin" single-process container </p><p> "fat" container </p><p> sshd in container</p></li><li><p> Container style </p><p> Service discovery</p><p> Networking</p><p>Lessons Learned</p><p> Managing secrets </p><p> App deployment </p><p> Docker annoyances</p></li><li><p>Services Discovery</p><p> Mesos-DNS: </p><p> ..marathon.mesos </p><p> record types: A / SRV </p><p> simple &amp; stateless</p></li><li><p> Container style </p><p> Service discovery </p><p> Networking</p><p>Lessons Learned</p><p> Managing secrets </p><p> App deployment </p><p> Docker annoyances</p></li><li><p>Networking</p><p> Project Calico: </p><p> IP-per-container </p><p> Pure Layer 3</p></li><li><p> Container style </p><p> Service discovery </p><p> Networking</p><p>Lessons Learned</p><p> Managing secrets</p><p> App deployment </p><p> Docker annoyances</p></li><li><p>Managing Secrets</p><p> ansible-vault</p></li><li><p> Container style </p><p> Service discovery </p><p> Networking</p><p>Lessons Learned</p><p> Managing secrets </p><p> App deployment</p><p> Docker annoyances</p></li><li><p>App deployment</p><p> ansible-playbook </p><p> marathon.json </p><p> docker tag name = git commit hash </p><p> 1 mesos cluster (3 VMs) per dev </p><p> deploy to servers deploy to marathon</p></li><li><p>marathon.json</p></li><li><p>https://flask-hello.marathon.mesos.vn/</p><p>https://flask-hello.marathon.mesos.vn/</p></li><li><p>Monitoring</p><p> Containers RAM used</p></li><li><p>Stateful Containers</p><p> Local persistent volumes</p></li><li><p> Container style </p><p> Service discovery </p><p> Networking</p><p>Lessons Learned</p><p> Managing secrets </p><p> App deployment </p><p> Docker annoyances</p></li><li><p>Docker </p><p> restart / upgrade docker without stopping the running containers </p><p> old images / tags cleanup </p><p> containers stdout / stderr log files </p><p> docker pull </p><p> docker hub</p></li><li><p>"Normal" container vs cloud-native container:</p><p> No manual steps </p><p> Service discovery friendly </p><p> Config files should be optional </p><p> Using env vars for config</p></li><li><p>1. What is Mesos? </p><p>2. How to run docker containers on Mesos </p><p>3. Lessons learned </p><p>4. Q&amp;A</p></li><li><p>Links</p><p> Mesos: http://mesos.apache.org/ </p><p> Marathon: https://mesosphere.github.io/marathon/ </p><p> Project Calico: https://www.projectcalico.org/ </p><p> Mesos-DNS: https://github.com/mesosphere/mesos-dns </p><p> A Healthy Platform Checklist: https://gist.github.com/andy-pham/04dedff872b33c07a31277afb900950b</p><p>http://mesos.apache.org/https://mesosphere.github.io/marathon/https://www.projectcalico.org/https://github.com/mesosphere/mesos-dnshttps://gist.github.com/andy-pham/04dedff872b33c07a31277afb900950b</p></li></ul>