Docker Workshop - Orchestrating Docker Containers

Download Docker Workshop - Orchestrating Docker Containers

Post on 19-Feb-2017




7 download


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/server containers/secOf course it needs orchestration23MesosMesos at Twitter 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 TEMPLATE 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. References + 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