DISTRIBUIÇÃO | Orquestrando Docker Containers

844 visualizações

Publicada em

Apresentação realizada no Meetup de 16 de julho na TOTVS.
Palestra sobre a tecnologia Docker Containers por Roberto G. Hashioka.

TOTVS. Juntos, fazemos melhor.

Aproveite também para conferir as novidades no site da TOTVS. Acesse: http://www.totvs.com. Ficou interessado? Agende uma visita com um de nossos consultores: https://www.totvs.com/contatos.

Siga a TOTVS nas redes sociais:
Facebook: https://www.facebook.com/totvs
Twitter: https://twitter.com/TOTVS
LinkedIn: https://www.linkedin.com/company/totvs

Publicada em: Software
0 comentários
6 gostaram
Estatísticas
Notas
  • Seja o primeiro a comentar

Sem downloads
Visualizações
Visualizações totais
844
No SlideShare
0
A partir de incorporações
0
Número de incorporações
52
Ações
Compartilhamentos
0
Downloads
39
Comentários
0
Gostaram
6
Incorporações 0
Nenhuma incorporação

Nenhuma nota no slide
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • Overview of Docker Machine
  • Script:

    You start with the command line to interact with Docker and your infrastructure which can be any mixture of local development machines, your private datacenter or public cloud instances
    Before you would have to log into every host and run through a series of installation and configuration tasks to provision a Docker engine
  • Animation auto-plays

    With Docker Machine, a single command “Machine Create” will provision the Docker Engines onto the hosts and get them up and running
    Our integration partners allow you to spin up Docker Engines onto local virtual machines, your data center or public cloud instances
  • Script:

    Single Docker Engines are great but once you start deploying more Engines and Containers to run on those Engines what you want is to get some failover and HA out of your application environment.

    CLICK

    With a single command you can join any number of Docker Engines into a single “virtual engine” that then pools the resources together.

    What’s great is that you no longer have to worry if a single Docker Engine goes down. Previously the Containers running on that Engine would have been affected but as a “pool” of resources, the containers are getting resources from the Swarm versus the single Docker Engine. So in case of a single Engine failure, your containers can still run on that Swarm
  • CLICK

    These pooled resources are viewed as a single engine to which the developer can provision application containers on.
    Swarm not only pools together a set of physical Docker Engines, it can also schedule the containers themselves and apply policies around them like how much resource needs to be available to container A versus container B.

    Additionally you can set rules so that certain containers cannot run on the same Docker Engine. Swarm will intelligently move the containers around within the Swam in compliance with the rules you have defined.
  • Docker Swarm natively provides the host clustering and container scheduling capabilities but as a open platform, we have partnered with a number of the ecosystem partners for integrations.

    Batteries included but swappable allows you to use the tools provided by Docker or leverage the investments you have already made in similar solutions.

    Partners like Mesosphere and Kubernetes work on top of Docker Swarm work on top of Swarm to schedule the containers

    Partners like IBM Bluemix, AWS, Joyent and Azure are integrating to provide Swarm services hosted in their cloud.
  • Script

    Docker Compose is purely about enabling multi-container applications in a manner that is simple and easy to use and maintain.

    A simple .YML text file is used to define everything related to your application from which image to pull, what ports to use, which volumes to mount to and how the containers should link together.

    CLICK

    Here is an example of an actual .YML file. AS you can see this application is made of two containers, a python app and a redis container that are linked together.
  • Once you have the .YML file defined, you just type a single command

    CLICK

    And Docker Compose will automatically build the containers in the order listed from the associated Dockerfile or pull the appropriate image from Docker Hub. Then the containers will be linked together and run on the identified Swarm. And now your application is live.
  • Docker Compose make changes to multi-container apps easier too. Now all you need to do is change the .YML file

    CLICK

    Then type your Docker command and it will re-execute the .YML file again to make the update.
  • Now that we’ve reviewed the product capabilities, let me show you how they work together from the viewpoint of an application.

    As you see here, we have the developers continuing to work in the same fashion they have – in their command line interface writing commands, they define their app inside the YML file.
    With additional commands like “Scale web N” you can instruct Docker Compose to spin up more containers of the web container. The web container as defined in the .YML file. If you have multiple Compose apps running, your command will first point to the correct .YML file and then the command to scale whichever container.

    From an operations perspective, there is flexibility on where and how to run the application based on any defined policies or SLAs they may have.

    Any application changes are easily passed inside of the Compose YML file
    Containerized application services make it easy to move, update and change the components so they are easily portable from dev to test to production environments hosted internally or in the cloud. Issues are easier to find and isolated and can be sent back into the dev/test cycle.

    A broad ecosystem allows organizations to leverage tools and processes they already have or allow for portability across vendors.

    Portable – Composable – Dynamic = A Docker Distributed Application
  • Overview of the launch announcement.

    Launch date
    Products included in the announcement, the code status and the github repo to download software
  • DISTRIBUIÇÃO | Orquestrando Docker Containers

    1. 1. Orquestrando Docker Containers Machine, Swarm e Compose Roberto G. Hashioka - @rhashioka – 2015-06-10 – São Paulo/SP
    2. 2. Informações Pessoais • Roberto Gandolfo Hashioka • @rogaha (Github) e @rhashioka (Twitter) • No Docker em Maio 2013 (Dotcloud) • Finanças -> Software Engineer • Projeto Atual: Docker Hub/Metrics
    3. 3. Objetivo da Apresentação • Explicar o que é o Docker e como usá-lo • Explicar o paradigma entre dev e ops • Explicar como rodar aplicaç ões distribuidas em qualquer ambiente • Compartilhar experiências (Silicon Valley)
    4. 4. O que é o Docker Engine? • Ferramenta que facilita a construção, distribuição e execução de qualquer a plicação em qualquer ambiente (VM, nuvem, servidor fisico, laptop) • Sua aplicação roda de forma isolada com seus próprios processos, IP e file system, independente do host. Ou seja, dentro de um container • Construção: empacota sua aplicação numa imagem (docker build) • Distribuição: Move a imagem entre diferentes maquinas (docker push/pull) • Execução: Execute sua aplicação (docker run)
    5. 5. Contrução: docker build – Dockerfile • Receita para criar uma imagem (container) • Começa de uma base: FROM ubuntu:14.04, fedora:20, debian:jessie • Rode comandos: RUN apt-get install –y firefox ssh • Copie seus dados: ADD /app/code /code/ • Crie scripts de inicialização ou execute arquivos binários: CMD start_firefox. sh, /usr/sbin/sshd –D
    6. 6. Exemplo de Dockerfile ----------------------------------------------------------------------------------------------------------- FROM ubuntu:14.04 MAINTAINER Roberto Hashioka (roberto@docker.com) RUN apt-get update && apt-get install -y nginx RUN echo ’Hello Developers from Sao Paulo' > /usr/share/nginx/html/index.html EXPOSE 80 ------------------------------------------------------------------------------------------------------------ $ docker build –t rogaha/web . $ docker run –d –p 80:80 –-name container_web_demo_sp rogaha/web
    7. 7. Distribuição: docker pull / push • Transfere sua aplicação dockerzizada de um servidor para outro • Registry Hub: Repositório central de imagens criadas pela comunidade • O objetivo principal do Registry Hub é facilitar a criação de aplicações • Milhares de images foram criadas e são mantidas pela comunidade. Por e xemplo: nginx, ubuntu, postgres, redis, node, centos, wordpress, java (https: //registry.hub.docker.com/repos/library/)
    8. 8. Execução: docker run • Roda as aplicações de forma consistente e confiável • Elimina os problemas de diferenças entre versionamento das dependências • Os containers rodam de forma isolada. Você pode rodar aplicações em Debi an, Ubuntu, CentOS na mesmo servidor/laptop • Se funciona no seu laptop, irá funcionar no servidor • RESOLVE grande parte dos problemas entre DEV e OPS
    9. 9. Estatíticas da comunidade Docker • > 950 Contribuidores no Github • > 80.000 Projetos dockerized no Github • > 140.000 Repositórios no Docker Hub • > 48.000 membros no Meetup.com, > 150 cidades, > 50 países • > 400.000.000 images do docker baixadas (docker pull)
    10. 10. Docker Machine: Zero to Docker em minutos Antes • Várias etapas de setup • Conecta a apenas um host • Instalação e configuração para aquele host específico Depois • Um comando de setup • Provisiona o Docker Engine em qualquer host • Integrações para criar hosts com o docker nas nuvens
    11. 11. Docker Machine
    12. 12. Docker Machine $ machine create
    13. 13. Docker Swarm: Otimize recursos, Tolerância a falhas e alta disponibilidade Before • Sem solução nativa • Cada Docker Engine é independente entre si After • Cluster de Docker Engines como se fosse um só • Interface única de dev. • Swarm dimensiona seu app • Agendamento nativa das app • Integração com outros agendadores
    14. 14. Docker Swarm $ docker run swarm
    15. 15. Docker Swarm $ docker run
    16. 16. Docker Swarm $ docker run Batteries included but swappable
    17. 17. Docker Compose: Simplifica Aplicações multi- container Before • Simples aplicações individuais em containers • Sem solução nativa para aplicações multi-containers • Ineficiente: Precisa repetir commandos para cada container After • Único arquivo .yml que define sua aplicação inteira • Rode sua aplicação completa com um único comando • Atualize facilmente sua aplicação com o arquivo .yml
    18. 18. Docker Compose containers: web: build: . command: python app.py ports: - "5000:5000" volumes: - .:/code links: - redis environment: - PYTHONUNBUFFERED=1 redis: image: redis:latest command: redis-server --appendonly yes
    19. 19. Docker Compose $ docker-compose
    20. 20. Docker Compose $ docker-compose
    21. 21. A Docker Distributed Application $ dockerHappy Devs Ops Flexibility Web x8 Cache x2Database x2
    22. 22. Ecosistema de Gestão de Containers Infrastructure Clustering and Scheduling Service Discovery
    23. 23. Informações dos Projetos • Projetos no Github • Docker – (github.com/docker/docker) • Docker Machine – (github.com/docker/machine) • Docker Swarm – (github.com/docker/swarm) • Docker Compose – (github.com/docker/compose) Aplicações distribuidas com Docker são modularizadas, portáveis e dinâmicas
    24. 24. Obrigado! Perguntas? @rhashioka

    ×