Anúncio
Anúncio

Mais conteúdo relacionado

Apresentações para você(20)

Similar a Using Docker with Puppet - PuppetConf 2014(20)

Anúncio

Último(20)

Anúncio

Using Docker with Puppet - PuppetConf 2014

  1. Docker and Puppet Containerization is the new virtualization
  2. What's this all about?
  3. What is Docker?
  4. Container virtualization
  5. Build, ship, run
  6. Build once.
  7. Run in many places.
  8. Isolated, layered, standard and content agnostic
  9. But this isn't new?!!?
  10. So why should I care? Software delivery mechanism - a bit like a package! Put your application in a container, run it anywhere A bit like a VM but ...
  11. Caring Containers boot faster Containers have less overhead Containers bring native performance Containers are Cloud & VM-compatible
  12. Docker Basics Image & Dockerfile The Docker Hub Container
  13. Building Docker images FROM ubuntu MAINTAINER James Turnbull "james@example.com" RUN apt-get -qqy update RUN apt-get install -qqy apache2 ADD index.html /var/www/ ENV APACHE_RUN_USER www-data ENV APACHE_RUN_GROUP www-data ENV APACHE_LOG_DIR /var/log/apache2 EXPOSE 80 ENTRYPOINT ["/usr/sbin/apache2"] CMD ["-D", "FOREGROUND"]
  14. Building the image $ sudo docker build -t="jamtur01/apache2" .
  15. Sharing the image $ sudo docker push jamtur01/apache2
  16. Running the container $ sudo docker run -ti -p 80:80 jamtur01/apache2
  17. Docker and Puppet
  18. So does the Dockerfile solve all?
  19. Well sorta... It depends.
  20. Doesn't have to deal with low-level stuff Doesn't have to converge Rebuilds are fast and cached Allows inheritance and composition Easy learning curve
  21. But...
  22. Doesn't deal with low-level stuff Doesn't define resource dependencies Doesn't define what runs when
  23. Dockerfile versus Shell script
  24. Shell scripts Okay for simple stacks Imperative Rarely idempotent
  25. Dockerfile versus Configuration Management
  26. The Good Handles low-level stuff Abstracts details Ensures convergence to a known state Library of reusable, composable templates
  27. The Bad Steep learning curve Generally requires a trigger Resource-intensive
  28. Digging and fixing, Having so much fun Working together, They get the job done
  29. Before Use Puppet to setup hardware, install packages, deploy code, run services. After Use Puppet to setup hardware, install Docker, run containers. Use Dockerfiles to install packages, deploy code, run services.
  30. Install Docker with Puppet
  31. Should I run Puppet in my containers?
  32. Nope!
  33. Should I use Puppet to build my images?
  34. Yep!
  35. Deploying a Puppet-powered container
  36. Puppet Apply FROM ubuntu:14.04 MAINTAINER James Turnbull "james@example.com" RUN apt-get -qqy update RUN apt-get -qqy install rubygems RUN gem install --no-ri --no-rdoc puppet RUN mkdir /puppet WORKDIR /puppet ADD site.pp /puppet/site.pp RUN puppet apply site.pp
  37. Librarian Puppet FROM ubuntu:14.04 MAINTAINER James Turnbull "james@example.com" RUN apt-get -y -q install wget git-core rubygems RUN gem install --no-ri --no-rdoc puppet librarian-puppet ADD Puppetfile / RUN librarian-puppet install RUN puppet apply --modulepath=/modules -e "class { 'nginx': }" RUN echo "daemon off;" >> /etc/nginx/nginx.conf EXPOSE 80 CMD ["nginx"]
  38. But there's more!
  39. What if we could get rid of... SSHd - Access via nsenter or docker exec Crond in a container Logging in a container
  40. Creates a new architecture
  41. Separates orthogonal concerns Don't rebuild your app to change services Have different policies in domains Ship lighter apps
Anúncio