docker workshop - orchestrating docker containers
Post on 19-Feb-2017
Embed Size (px)
Docker Workshop - 2nd Day
Orchestrating Docker Containers
Hugo Arraes Henley - hugohenley at id dot uff dot br
Ecosystem - An overview
CI and Deploy
Before 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 cellphones3
and much more
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
Of course it needs orchestration
Mesos at Twitter
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 APP
Nice! But how people can access my app if I have no control about where it is running?
4 REDIS INSTANCES
For every new container, a software called registrator sends the list of running containers to the consul server
$ docker run -d \ --name=registrator \ --net=host \ --volume=/var/run/docker.sock:/tmp/docker.sock \ gliderlabs/registrator:latest \ consul://localhost:8500
Consul 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 :)
Prometheus 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.
Docker + Mesos + Marathon + Rancher + Consul + Registrator + Consul Template + cAdvisor + Prometheus + Grafana
YOU WILL NEED A CI
PUTTING EVERYTHING TOGETHER
Docker + Mesos + Marathon + Rancher + Consul + Registrator + Consul Template + cAdvisor + Prometheus + Grafana + Jenkins
Remember: there is no silver bullet!
hugohenley at id dot uff dot br