Docker Workshop - Orchestrating Docker Containers
Post on 19-Feb-2017
24/11/2016Docker Workshop - 2nd DayOrchestrating Docker ContainersHugo Arraes Henley - hugohenley at id dot uff dot br1Agenda Ecosystem - An overview Rancher Mesos Marathon Service Discovery Monitoring Systems CI and DeployBefore we start Questions: #workshop-docker at Slack Urgent questions: ask anytime We will have a break at 15:45~16:00 Today: 80 slides Check your cellphones3The Ecosystem4The Ecosystemand more5The Ecosystemand much more78Rancher Provides a web interface to manage your containers Helps you to create your own cluster Helps you to deploy your containerized apps Natively supports and manages all of your Kubernetes, Mesos, and Swarm clusters. Easy to install!sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/serverhttps://docs.rancher.com/rancher/v1.2/en/installing-rancher/installing-server/16https://speakerdeck.com/jbeda/containers-at-scale3300 containers/secOf course it needs orchestration23MesosMesoshttps://www.linux.com/news/4-unique-ways-uber-twitter-paypal-and-hubspot-use-apache-mesosMesos at Twitterhttps://mesosphere.com/blog/2014/06/11/how-twitter-uses-mesos-video/In step (1), slave 1 reports to the master that it has 4 CPUs and 4 GB of memory free. The master then invokes the allocation module, which tells it that framework 1 should be offered all available resources. In step (2), the master sends a resource offer describing these resources to framework 1. In step (3), the frameworks scheduler replies to the master with information about two tasks to run on the slave, using 2 CPUs, 1 GB RAM for the first task, and 1 CPUs, 2 GB RAM for the second task. Finally, in step (4), the master sends the tasks to the slave, which allocates appropriate resources to the frameworks executor, which in turn launches the two tasks (depicted with dotted borders). Because 1 CPU and 1 GB of RAM are still free, the allocation module may now offer them to framework 2. CREATING A NEW APPNice! But how people can access my app if I have no control about where it is running?SERVICE DISCOVERY444 REDIS INSTANCESSCALING DOWNFor every new container, a software called registrator sends the list of running containers to the consul servergliderlabs/registrator$ docker run -d \ --name=registrator \ --net=host \ --volume=/var/run/docker.sock:/tmp/docker.sock \ gliderlabs/registrator:latest \ consul://localhost:8500HAPROXY TEMPLATEhttp://sirile.github.io/2015/05/18/using-haproxy-and-consul-for-dynamic-service-discovery-on-docker.htmlConsul template updates your HAProxy configuration file based on what is running!Thats why your clients can access your app, no matter where it's running :)Monitoring57Prometheus collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true. https://www.infoq.com/news/2015/12/dockercon-docker-monitoringhttps://github.com/vegasbrianc/prometheusPrometheus References https://developers.soundcloud.com/blog/prometheus-monitoring-at-soundcloud https://www.brianchristner.io/how-to-setup-prometheus-docker-monitoring/ https://prometheus.io/docs/instrumenting/exporters/ https://www.infoq.com/news/2015/12/dockercon-docker-monitoring https://github.com/vegasbrianc/prometheus https://www.brianchristner.io/updated-docker-monitoring-prometheus-grafana/ https://www.ctl.io/developers/blog/post/monitoring-docker-services-with-prometheus/https://developers.soundcloud.com/blog/prometheus-monitoring-at-soundcloudhttps://www.brianchristner.io/how-to-setup-prometheus-docker-monitoring/https://prometheus.io/docs/instrumenting/exporters/https://www.infoq.com/news/2015/12/dockercon-docker-monitoringhttps://github.com/vegasbrianc/prometheushttps://www.brianchristner.io/updated-docker-monitoring-prometheus-grafana/https://www.ctl.io/developers/blog/post/monitoring-docker-services-with-prometheus/65RECAPDocker + Mesos + Marathon + Rancher + Consul + Registrator + Consul Template + cAdvisor + Prometheus + Grafana=:)DEPLOYINGYOU WILL NEED A CIPUTTING EVERYTHING TOGETHERregistratorconsul-templateDevUserDocker + Mesos + Marathon + Rancher + Consul + Registrator + Consul Template + cAdvisor + Prometheus + Grafana + Jenkins=:)Remember: there is no silver bullet!81Thank you!82hugohenley at id dot uff dot br
View more >
What is Docker? Where is Docker being used? N TEN T S DOCKER TECHBRIEF INTRODUCTION What is MongoDB? Containers 101: Linux containers and Docker explained Docker Container Tutorials Docker containers are extremely popular and for good reasons. Chief ...
Containers and Docker - Red Docker 101 Working with existing containers. $ docker start httpd_container $ docker stop httpd_container $ docker kill httpd_container $ docker commit httpd_container rhel7/httpd List running containers