SlideShare a Scribd company logo
1 of 27
Download to read offline
Beyond Golden Containers
Complementing Docker with Puppet
David Lutterkort	
  
lutter@puppetlabs.com
http://northshorekid.com/event/campfire-stories-marini-farm
http://www.partialhospitalization.com/2010/08/363/
lang en_US.UTF-8
keyboard us
…
rootpw --iscrypted $1$uw6MV$m6VtUWPed4SqgoW6fKfTZ/
part / --size 1024 --fstype ext4 --ondisk sda
!
repo --name=fedora —mirrorlist=…
repo --name=updates —mirrorlist=…
!
%packages
@core
%end
!
%post
curl http://example.com/the-script.pl | /usr/bin/perl
!
What’s that machine doing ?
4
5http://www.gcksa.com/en/
6http://grillingwithrich.com/wrapping-meats-the-positives-and-negatives-and-everything-in-between/foil-ball
Overview
• Puppet	
  from	
  10,000	
  feet	
  
• Managing	
  the	
  host	
  
• Building	
  images	
  
– without	
  a	
  master	
  (puppet apply)	
  
– with	
  a	
  master	
  (puppet agent)	
  
• Run9me	
  configura9on
7
Infrastructure as Code
8
1)DEFINE 2)SIMULATE
4)REPORT 3)ENFORCE
Re-usable infrastructure-as-code
Insight into changes
Before deploying changes
Automatically and reliably
Dataflow in Puppet
9
class webserver {


package { 'httpd':

ensure => latest

} ->



file { '/etc/httpd/conf.d/local.conf':

ensure => file,

mode => 644,

source => 'puppet:///modules/httpd/local.conf',

} ->



service { 'httpd':

ensure => running,

enable => true,

subscribe => File['/etc/httpd/conf.d/local.conf'],

}

!
}
A basic manifest
10
class webserver2 inherits webserver {



File['/etc/httpd/conf.d/local.conf'] {

source => 'puppet:///modules/httpd/other-local.conf',

}



}

Override via inheritance
11
The site-wide manifest
12
node host1.example.com {

class { 'webserver': }

}

!


node host2.example.com {

class { 'webserver2': }

}

!


node host3.example.com {

class {'mongodb::server':

port => 27018

}

}

13
Overview
• Puppet	
  from	
  10,000	
  feet	
  
• Managing	
  the	
  host	
  
• Building	
  images	
  
– without	
  a	
  master	
  (puppet apply)	
  
– with	
  a	
  master	
  (puppet agent)	
  	
  
• Run9me	
  configura9on
14
Managing the host
Gareth	
  Rushgrove’s	
  module:	
  	
  
	
  	
  	
  	
  hKps://forge.puppetlabs.com/garethr/docker	
  
!
• Install	
  docker	
  (Ubuntu	
  and	
  CentOS)	
  
• Manage	
  images	
  
• Run	
  containers
15
!
class { 'docker':

tcp_bind => 'tcp://127.0.0.1:4243',

socket_bind => 'unix:///var/run/docker.sock',

}

Setting up Docker
16
!
docker::image { 'ubuntu':

image_tag => 'precise'

}

Pulling down images
17
!
docker::run { 'appserver2':

image => 'fedora:20',

command => '/usr/sbin/init',

ports => ['80', '443'],

links => ['mysql:db'],

use_name => true,

volumes => ['/var/lib/couchdb', '/var/log'],

volumes_from => 'appserver1',

memory_limit => 10485760, # bytes 

username => 'appy',

hostname => 'app2.example.com',

env => ['FOO=BAR', 'FOO2=BAR2'],

dns => ['8.8.8.8', ‘8.8.4.4']
}
Running containers
18
Overview
• Puppet	
  from	
  10,000	
  feet	
  
• Managing	
  the	
  host	
  
• Building	
  images	
  
– without	
  a	
  master	
  (puppet apply)	
  
– with	
  a	
  master	
  (puppet agent)	
  
• Run9me	
  configura9on
19
Dockerfile for puppet apply
20
FROM jamtur01/puppetbase

MAINTAINER James Turnbull <james@lovedthanlost.net>



ADD modules /tmp/modules

RUN yum -y install puppet; 

puppet apply --modulepath=/tmp/modules 
-e "class { 'nginx': service_ensure => disable }”



EXPOSE 80

CMD ["nginx"]

Overview
• Puppet	
  from	
  10,000	
  feet	
  
• Managing	
  the	
  host	
  
• Building	
  images	
  
– without	
  a	
  master	
  (puppet apply)	
  
– with	
  a	
  master	
  (puppet agent)	
  
• Run9me	
  configura9on
21
!
FROM fedora:20

MAINTAINER David Lutterkort <lutter@watzmann.net>



ADD puppet /tmp/puppet-docker



RUN yum -y install puppet; 

yum clean all; 

/tmp/puppet-docker/bin/puppet-docker

Dockerfile for puppet agent
22
> tree puppet
!
puppet/
├── bin
│ └── puppet-docker
├── config.yaml
└── ssl
├── agent-cert.pem
├── agent-private.pem
├── agent-public.pem
└── ca.pem
!
Support files
23
> cat puppet/config.yaml
!
---

certname: docker

# server: puppet-master.example.com

facts:

container: docker

build: true

!
Configure agent run
24
Overview
• Puppet	
  from	
  10,000	
  feet	
  
• Managing	
  the	
  host	
  
• Building	
  images	
  
– without	
  a	
  master	
  (puppet apply)	
  
– with	
  a	
  master	
  (puppet agent)	
  
• Run<me	
  configura<on
25
Runtime configuration
• Install	
  an	
  init	
  system	
  (systemd)	
  
– run	
  cron	
  or	
  puppetd	
  
– run	
  target	
  service(s)	
  
• Possibly	
  move	
  to	
  one	
  agent	
  per	
  host
26
Summary
• Explain	
  what	
  you	
  are	
  doing	
  clearly	
  
(or	
  scare	
  those	
  trying	
  to	
  understand	
  you	
  to	
  death)	
  	
  
• Manage	
  container	
  hosts	
  with

	
  	
  	
  	
  hKps://forge.puppetlabs.com/garethr/docker	
  
• Sample	
  materials	
  for	
  puppet agent	
  etc.	
  at

	
  	
  	
  	
  hKps://github.com/luKer/puppet-­‐docker	
  
!
27
Ques9ons	
  ?

More Related Content

What's hot

Redmine on amazon ec2
Redmine on amazon ec2Redmine on amazon ec2
Redmine on amazon ec2Ikuru Kanuma
 
Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Tio Aldiansyah
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의Juhong Jung
 
Solaris 11 base box for Vagrant using Packer
Solaris 11 base box for Vagrant using PackerSolaris 11 base box for Vagrant using Packer
Solaris 11 base box for Vagrant using PackerAlan Chalmers
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101jelrikvh
 
Scaling IO-bound microservices
Scaling IO-bound microservicesScaling IO-bound microservices
Scaling IO-bound microservicesSalo Shp
 
rush, the Ruby shell and Unix integration library
rush, the Ruby shell and Unix integration libraryrush, the Ruby shell and Unix integration library
rush, the Ruby shell and Unix integration libraryAdam Wiggins
 
using Virtualbox NAT and shared folder
using Virtualbox NAT and shared folderusing Virtualbox NAT and shared folder
using Virtualbox NAT and shared folderYingshiuan Pan
 
How to Install Ghost (CMS) MEMO
How to Install Ghost (CMS) MEMOHow to Install Ghost (CMS) MEMO
How to Install Ghost (CMS) MEMONaoto MATSUMOTO
 
RabbitMQ Server - cheat sheet -
RabbitMQ Server - cheat sheet -RabbitMQ Server - cheat sheet -
RabbitMQ Server - cheat sheet -Naoto MATSUMOTO
 
Sfd hanoi2012 nguyen nang thang sfd-2012_chroot_apache
Sfd hanoi2012 nguyen nang thang   sfd-2012_chroot_apacheSfd hanoi2012 nguyen nang thang   sfd-2012_chroot_apache
Sfd hanoi2012 nguyen nang thang sfd-2012_chroot_apacheVu Hung Nguyen
 
Deep Visibility for Production Microservices
Deep Visibility for Production MicroservicesDeep Visibility for Production Microservices
Deep Visibility for Production MicroservicesPaul Bauer
 
3 manual installation of open vpn
3 manual installation of open vpn3 manual installation of open vpn
3 manual installation of open vpnAshwajit Maske
 
wordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jailwordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jailJongseok Choi
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -Naoto MATSUMOTO
 

What's hot (20)

Message Decrypt
Message DecryptMessage Decrypt
Message Decrypt
 
Redmine on amazon ec2
Redmine on amazon ec2Redmine on amazon ec2
Redmine on amazon ec2
 
Proxy server ubuntu 12.04
Proxy server ubuntu 12.04Proxy server ubuntu 12.04
Proxy server ubuntu 12.04
 
OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의OSS AWS 핸즈온 강의
OSS AWS 핸즈온 강의
 
Solaris 11 base box for Vagrant using Packer
Solaris 11 base box for Vagrant using PackerSolaris 11 base box for Vagrant using Packer
Solaris 11 base box for Vagrant using Packer
 
How about Gradle?
How about Gradle?How about Gradle?
How about Gradle?
 
Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101Environments line-up! Vagrant & Puppet 101
Environments line-up! Vagrant & Puppet 101
 
Scaling IO-bound microservices
Scaling IO-bound microservicesScaling IO-bound microservices
Scaling IO-bound microservices
 
rush, the Ruby shell and Unix integration library
rush, the Ruby shell and Unix integration libraryrush, the Ruby shell and Unix integration library
rush, the Ruby shell and Unix integration library
 
using Virtualbox NAT and shared folder
using Virtualbox NAT and shared folderusing Virtualbox NAT and shared folder
using Virtualbox NAT and shared folder
 
How to Install Ghost (CMS) MEMO
How to Install Ghost (CMS) MEMOHow to Install Ghost (CMS) MEMO
How to Install Ghost (CMS) MEMO
 
RabbitMQ Server - cheat sheet -
RabbitMQ Server - cheat sheet -RabbitMQ Server - cheat sheet -
RabbitMQ Server - cheat sheet -
 
Sfd hanoi2012 nguyen nang thang sfd-2012_chroot_apache
Sfd hanoi2012 nguyen nang thang   sfd-2012_chroot_apacheSfd hanoi2012 nguyen nang thang   sfd-2012_chroot_apache
Sfd hanoi2012 nguyen nang thang sfd-2012_chroot_apache
 
Deep Visibility for Production Microservices
Deep Visibility for Production MicroservicesDeep Visibility for Production Microservices
Deep Visibility for Production Microservices
 
Nagios
NagiosNagios
Nagios
 
3 manual installation of open vpn
3 manual installation of open vpn3 manual installation of open vpn
3 manual installation of open vpn
 
wordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jailwordpress with nginx on virtualization, jail
wordpress with nginx on virtualization, jail
 
Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013Puppet without Root - PuppetConf 2013
Puppet without Root - PuppetConf 2013
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -MQTTS mosquitto - cheat sheet -
MQTTS mosquitto - cheat sheet -
 

Viewers also liked

Puppet overview
Puppet overviewPuppet overview
Puppet overviewjoshbeard
 
DockerCon14 Performance Characteristics of Traditional VMs vs. Docker Containers
DockerCon14 Performance Characteristics of Traditional VMs vs. Docker ContainersDockerCon14 Performance Characteristics of Traditional VMs vs. Docker Containers
DockerCon14 Performance Characteristics of Traditional VMs vs. Docker ContainersDocker, Inc.
 
Dockerfile Basics Workshop #2
Dockerfile Basics Workshop #2Dockerfile Basics Workshop #2
Dockerfile Basics Workshop #2Docker, Inc.
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressDocker, Inc.
 
Docker at RelateIQ
Docker at RelateIQDocker at RelateIQ
Docker at RelateIQDocker, Inc.
 
DockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image DistributionDockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image DistributionDocker, Inc.
 
WOT Cloud Computing Architect Summit
WOT Cloud Computing Architect SummitWOT Cloud Computing Architect Summit
WOT Cloud Computing Architect SummitDocker, Inc.
 
DockerCon14 John Engates
DockerCon14 John EngatesDockerCon14 John Engates
DockerCon14 John EngatesDocker, Inc.
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryDocker, Inc.
 
AWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and DockerAWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and DockerDocker, Inc.
 
DockerCon14 The Road Ahead by Solomon
DockerCon14 The Road Ahead by SolomonDockerCon14 The Road Ahead by Solomon
DockerCon14 The Road Ahead by SolomonDocker, Inc.
 
DockerCon SF 2015: Orchestration for Devs (machine + compose)
DockerCon SF 2015:  Orchestration for Devs (machine + compose)DockerCon SF 2015:  Orchestration for Devs (machine + compose)
DockerCon SF 2015: Orchestration for Devs (machine + compose)Docker, Inc.
 
Docker, Containers and the Future of Application Delivery
Docker, Containers and the Future of Application DeliveryDocker, Containers and the Future of Application Delivery
Docker, Containers and the Future of Application DeliveryDocker, Inc.
 
Installing and Running Postfix within a Docker Container
Installing and Running Postfix within a Docker ContainerInstalling and Running Postfix within a Docker Container
Installing and Running Postfix within a Docker ContainerDocker, Inc.
 
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael CrosbyDocker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael CrosbyDocker, Inc.
 
DockerCon SF 2015: Orchestration for Sysadmins
DockerCon SF 2015: Orchestration for SysadminsDockerCon SF 2015: Orchestration for Sysadmins
DockerCon SF 2015: Orchestration for SysadminsDocker, Inc.
 
Getting Started Contributing to Docker
Getting Started Contributing to DockerGetting Started Contributing to Docker
Getting Started Contributing to DockerDocker, Inc.
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on OpenstackDocker, Inc.
 
Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker, Inc.
 

Viewers also liked (20)

Puppet overview
Puppet overviewPuppet overview
Puppet overview
 
DockerCon14 Performance Characteristics of Traditional VMs vs. Docker Containers
DockerCon14 Performance Characteristics of Traditional VMs vs. Docker ContainersDockerCon14 Performance Characteristics of Traditional VMs vs. Docker Containers
DockerCon14 Performance Characteristics of Traditional VMs vs. Docker Containers
 
OpenStack Boston
OpenStack BostonOpenStack Boston
OpenStack Boston
 
Dockerfile Basics Workshop #2
Dockerfile Basics Workshop #2Dockerfile Basics Workshop #2
Dockerfile Basics Workshop #2
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
Docker at RelateIQ
Docker at RelateIQDocker at RelateIQ
Docker at RelateIQ
 
DockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image DistributionDockerCon SF 2015: A New Model for Image Distribution
DockerCon SF 2015: A New Model for Image Distribution
 
WOT Cloud Computing Architect Summit
WOT Cloud Computing Architect SummitWOT Cloud Computing Architect Summit
WOT Cloud Computing Architect Summit
 
DockerCon14 John Engates
DockerCon14 John EngatesDockerCon14 John Engates
DockerCon14 John Engates
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software Delivery
 
AWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and DockerAWS Elastic Beanstalk and Docker
AWS Elastic Beanstalk and Docker
 
DockerCon14 The Road Ahead by Solomon
DockerCon14 The Road Ahead by SolomonDockerCon14 The Road Ahead by Solomon
DockerCon14 The Road Ahead by Solomon
 
DockerCon SF 2015: Orchestration for Devs (machine + compose)
DockerCon SF 2015:  Orchestration for Devs (machine + compose)DockerCon SF 2015:  Orchestration for Devs (machine + compose)
DockerCon SF 2015: Orchestration for Devs (machine + compose)
 
Docker, Containers and the Future of Application Delivery
Docker, Containers and the Future of Application DeliveryDocker, Containers and the Future of Application Delivery
Docker, Containers and the Future of Application Delivery
 
Installing and Running Postfix within a Docker Container
Installing and Running Postfix within a Docker ContainerInstalling and Running Postfix within a Docker Container
Installing and Running Postfix within a Docker Container
 
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael CrosbyDocker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
Docker 1.11 Meetup: Containerd and runc, by Arnaud Porterie and Michael Crosby
 
DockerCon SF 2015: Orchestration for Sysadmins
DockerCon SF 2015: Orchestration for SysadminsDockerCon SF 2015: Orchestration for Sysadmins
DockerCon SF 2015: Orchestration for Sysadmins
 
Getting Started Contributing to Docker
Getting Started Contributing to DockerGetting Started Contributing to Docker
Getting Started Contributing to Docker
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
 
Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF Meetup
 

Similar to Complementing Docker with Puppet

PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetWalter Heck
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetOlinData
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Herokuronnywang_tw
 
Hands-On Session Docker
Hands-On Session DockerHands-On Session Docker
Hands-On Session DockerLinetsChile
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptxwonyong hwang
 
CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015Brandon Philips
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data scienceCalvin Giles
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a NutshellCoreOS
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @Wayra
Deis, a PaaS built with Docker,  Docker Meetup Sao Paulo #3 @WayraDeis, a PaaS built with Docker,  Docker Meetup Sao Paulo #3 @Wayra
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @WayraLeo Lorieri
 

Similar to Complementing Docker with Puppet (20)

PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
Hands-On Session Docker
Hands-On Session DockerHands-On Session Docker
Hands-On Session Docker
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptx
 
CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
 
Docker: ao vivo e a cores
Docker: ao vivo e a coresDocker: ao vivo e a cores
Docker: ao vivo e a cores
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a Nutshell
 
Simple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE LabSimple docker hosting in FIWARE Lab
Simple docker hosting in FIWARE Lab
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Docker
DockerDocker
Docker
 
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @Wayra
Deis, a PaaS built with Docker,  Docker Meetup Sao Paulo #3 @WayraDeis, a PaaS built with Docker,  Docker Meetup Sao Paulo #3 @Wayra
Deis, a PaaS built with Docker, Docker Meetup Sao Paulo #3 @Wayra
 

More from Docker, Inc.

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Docker, Inc.
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXDocker, Inc.
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeDocker, Inc.
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDocker, Inc.
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubDocker, Inc.
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices WorldDocker, Inc.
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...Docker, Inc.
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with DockerDocker, Inc.
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeDocker, Inc.
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryDocker, Inc.
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Docker, Inc.
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog ScaleDocker, Inc.
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels Docker, Inc.
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...Docker, Inc.
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDocker, Inc.
 

More from Docker, Inc. (20)

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINX
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and Compose
 
Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at Salesforce
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices World
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with Docker
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio Code
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container Registry
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm Architecture
 

Complementing Docker with Puppet

  • 1. Beyond Golden Containers Complementing Docker with Puppet David Lutterkort   lutter@puppetlabs.com
  • 4. lang en_US.UTF-8 keyboard us … rootpw --iscrypted $1$uw6MV$m6VtUWPed4SqgoW6fKfTZ/ part / --size 1024 --fstype ext4 --ondisk sda ! repo --name=fedora —mirrorlist=… repo --name=updates —mirrorlist=… ! %packages @core %end ! %post curl http://example.com/the-script.pl | /usr/bin/perl ! What’s that machine doing ? 4
  • 7. Overview • Puppet  from  10,000  feet   • Managing  the  host   • Building  images   – without  a  master  (puppet apply)   – with  a  master  (puppet agent)   • Run9me  configura9on 7
  • 8. Infrastructure as Code 8 1)DEFINE 2)SIMULATE 4)REPORT 3)ENFORCE Re-usable infrastructure-as-code Insight into changes Before deploying changes Automatically and reliably
  • 10. class webserver { 
 package { 'httpd':
 ensure => latest
 } ->
 
 file { '/etc/httpd/conf.d/local.conf':
 ensure => file,
 mode => 644,
 source => 'puppet:///modules/httpd/local.conf',
 } ->
 
 service { 'httpd':
 ensure => running,
 enable => true,
 subscribe => File['/etc/httpd/conf.d/local.conf'],
 }
 ! } A basic manifest 10
  • 11. class webserver2 inherits webserver {
 
 File['/etc/httpd/conf.d/local.conf'] {
 source => 'puppet:///modules/httpd/other-local.conf',
 }
 
 }
 Override via inheritance 11
  • 12. The site-wide manifest 12 node host1.example.com {
 class { 'webserver': }
 }
 ! 
 node host2.example.com {
 class { 'webserver2': }
 }
 ! 
 node host3.example.com {
 class {'mongodb::server':
 port => 27018
 }
 }

  • 13. 13
  • 14. Overview • Puppet  from  10,000  feet   • Managing  the  host   • Building  images   – without  a  master  (puppet apply)   – with  a  master  (puppet agent)     • Run9me  configura9on 14
  • 15. Managing the host Gareth  Rushgrove’s  module:            hKps://forge.puppetlabs.com/garethr/docker   ! • Install  docker  (Ubuntu  and  CentOS)   • Manage  images   • Run  containers 15
  • 16. ! class { 'docker':
 tcp_bind => 'tcp://127.0.0.1:4243',
 socket_bind => 'unix:///var/run/docker.sock',
 }
 Setting up Docker 16
  • 17. ! docker::image { 'ubuntu':
 image_tag => 'precise'
 }
 Pulling down images 17
  • 18. ! docker::run { 'appserver2':
 image => 'fedora:20',
 command => '/usr/sbin/init',
 ports => ['80', '443'],
 links => ['mysql:db'],
 use_name => true,
 volumes => ['/var/lib/couchdb', '/var/log'],
 volumes_from => 'appserver1',
 memory_limit => 10485760, # bytes 
 username => 'appy',
 hostname => 'app2.example.com',
 env => ['FOO=BAR', 'FOO2=BAR2'],
 dns => ['8.8.8.8', ‘8.8.4.4'] } Running containers 18
  • 19. Overview • Puppet  from  10,000  feet   • Managing  the  host   • Building  images   – without  a  master  (puppet apply)   – with  a  master  (puppet agent)   • Run9me  configura9on 19
  • 20. Dockerfile for puppet apply 20 FROM jamtur01/puppetbase
 MAINTAINER James Turnbull <james@lovedthanlost.net>
 
 ADD modules /tmp/modules
 RUN yum -y install puppet; 
 puppet apply --modulepath=/tmp/modules -e "class { 'nginx': service_ensure => disable }”
 
 EXPOSE 80
 CMD ["nginx"]

  • 21. Overview • Puppet  from  10,000  feet   • Managing  the  host   • Building  images   – without  a  master  (puppet apply)   – with  a  master  (puppet agent)   • Run9me  configura9on 21
  • 22. ! FROM fedora:20
 MAINTAINER David Lutterkort <lutter@watzmann.net>
 
 ADD puppet /tmp/puppet-docker
 
 RUN yum -y install puppet; 
 yum clean all; 
 /tmp/puppet-docker/bin/puppet-docker
 Dockerfile for puppet agent 22
  • 23. > tree puppet ! puppet/ ├── bin │ └── puppet-docker ├── config.yaml └── ssl ├── agent-cert.pem ├── agent-private.pem ├── agent-public.pem └── ca.pem ! Support files 23
  • 24. > cat puppet/config.yaml ! ---
 certname: docker
 # server: puppet-master.example.com
 facts:
 container: docker
 build: true
 ! Configure agent run 24
  • 25. Overview • Puppet  from  10,000  feet   • Managing  the  host   • Building  images   – without  a  master  (puppet apply)   – with  a  master  (puppet agent)   • Run<me  configura<on 25
  • 26. Runtime configuration • Install  an  init  system  (systemd)   – run  cron  or  puppetd   – run  target  service(s)   • Possibly  move  to  one  agent  per  host 26
  • 27. Summary • Explain  what  you  are  doing  clearly   (or  scare  those  trying  to  understand  you  to  death)     • Manage  container  hosts  with
        hKps://forge.puppetlabs.com/garethr/docker   • Sample  materials  for  puppet agent  etc.  at
        hKps://github.com/luKer/puppet-­‐docker   ! 27 Ques9ons  ?