SlideShare a Scribd company logo
1 of 50
Download to read offline
2014 
Presented by 
How Puppet Enables 
the Use of Lightweight 
Virtualized Containers 
Jeff McCune 
Software Developer | Puppet Labs 
@0xEFF
What we’ll cover 
Compare and contrasts a Jenkins+LDAP deployed onto 
virtual machines and onto lightweight containers. 
Presented by 
! 
Jenkins and LDAP Puppet Forge Modules 
Migrating from a shared VM to containers 
Common Problems with Service Management 
Summary of Lessons Learned
Presented by 
Starting Point 
https://github.com/jeffmccune/puppetconf2014 
Traditional VM 
Puppet deploys Jenkins with LDAP security 
http://sharedvm:18080
Presented by 
Shared VM 
Vagrant VM 
Puppet 
Jenkins OpenLDAP 
Puppet configures Jenkins 
and OpenLDAP 
Vagrant Puppet 
provisioner
Presented by 
Migrating to Containers 
Vagrant VM 
Puppet at runtime 
Jenkins OpenLDAP 
Docker Host 
! 
! 
OpenLDAP 
Container 
Puppet at 
build ! 
time 
! 
Jenkins 
Container 
Puppet at 
build time
Puppet Forge module re-use 
It is faster to deploy Jenkins with LDAP using forge modules: 
rtyler/jenkins module 
90% code re-use: 831 lines from the Forge, 88 lines added 
camptocamp/openldap module 
85% code re-use: 584 lines from the Forge, 108 lines added 
Presented by
Presented by 
Site Specific Customizations 
Initialize LDAP for dc=jeffmccune,dc=net 
Configure LDAP admin account and password 
Load initial schema and base OU’s into LDAP 
Configure Jenkins to use LDAP security
Moving from a VM to a Container 
Challenges in Puppet: 
Service resources fail and must be overridden 
Downstream resources require the service resource 
LDAP initial schema load requires Service[slapd] 
Presented by
Why do service resources fail? 
Two different models of containers: 
Those with and without a service management framework. 
In either case there is no service management framework 
running during the image build phase. 
Presented by
Presented by 
Containers 
Two Models of Containers: 
OS Virtualization Model - Heavy 
(Solaris Zones, FreeBSD Jails, IBM WPAR’s) 
Microservice Model - Light 
(Docker, CoreOS, Kubernetes)
False Dichotomy over “Light” 
Weight is a range, not a boolean. 
Single-process image 
Multi-process image 
Full-os image 
Runtime manageability decreases as processes decrease 
Presented by
Single-process Microservices 
In general: 
Executes the application process directly, no init system 
startup time comparable to normal process startup 
Puppet does not operate at runtime 
Difficult to manage with volumes and sidekick processes 
Presented by
Multi-process Microservices 
In general: 
Start an init system (SysV init, systemd, upstart) 
The service management framework manages services 
Runs ~5 or more processes per container 
Puppet works at runtime without modification 
Presented by
Full OS Virtualization Containers 
Run everything a traditional OS would run 
Dozens of running processes in the container 
Long startup time (> 30 seconds) 
Easier to manage at runtime 
Better for some situations, e.g. mimicking a full running OS 
Presented by
Container Images 
Microservice containers have a distinct build phase 
The result of the build step is an image, ideally immutable 
Instances execute from a built base image 
The Dockerfile is an example of a build script 
Presented by
Dockerfile 
FROM centos:centos7 
ADD puppet.tar.gz / 
RUN puppet apply -v --modulepath=/puppet/modules  
/puppet/manifests/ldap.pp 
EXPOSE 389 
CMD ["/usr/sbin/init"] 
Presented by
Dockerfile 
FROM centos:centos7 
ADD puppet.tar.gz / 
RUN puppet apply -v --modulepath=/puppet/modules  
/puppet/manifests/ldap.pp 
EXPOSE 389 
CMD ["/usr/sbin/init"] 
Presented by
Dockerfile 
FROM centos:centos7 
ADD puppet.tar.gz / 
RUN puppet apply -v --modulepath=/puppet/modules  
/puppet/manifests/ldap.pp 
EXPOSE 389 
CMD ["/usr/sbin/init"] 
Presented by
Dockerfile 
FROM centos:centos7 
ADD puppet.tar.gz / 
RUN puppet apply -v --modulepath=/puppet/modules  
/puppet/manifests/ldap.pp 
EXPOSE 389 
CMD ["/usr/sbin/init"] 
Presented by
Presented by 
docker build 
$ docker build --tag base_image . 
Sending build context to Docker daemon 4.718 MB 
Step 0 : FROM centos:centos7 
---> 3236320e3562 
Step 1 : ADD puppet.tar.gz / 
---> bc9aa11de092 
Step 2 : RUN puppet apply … 
---> Running in efdda7633bfc
docker build 
$ docker build --tag base_image . 
Sending build context to Docker daemon 4.718 MB 
Step 0 : FROM centos:centos7 
---> 3236320e3562 
Step 1 : ADD puppet.tar.gz / 
---> bc9aa11de092 
Step 2 : RUN puppet apply … 
---> Running in efdda7633bfc 
Presented by
Presented by 
docker build 
$ docker build --tag base_image . 
Sending build context to Docker daemon 4.718 MB 
Step 0 : FROM centos:centos7 
---> 3236320e3562 
Step 1 : ADD puppet.tar.gz / 
---> bc9aa11de092 
Step 2 : RUN puppet apply … 
---> Running in efdda7633bfc
Presented by 
docker build 
$ docker build --tag base_image . 
Sending build context to Docker daemon 4.718 MB 
Step 0 : FROM centos:centos7 
---> 3236320e3562 
Step 1 : ADD puppet.tar.gz / 
---> bc9aa11de092 
Step 2 : RUN puppet apply … 
---> Running in efdda7633bfc
Docker Build with Puppet Try #1 
Error: /Service[slapd]: Could not evaluate: 
Could not find init script for 'slapd' 
Warning: Openldap_database[dc=jeffmccune,dc=net]: 
Skipping because of failed dependencies 
Warning: Exec[inetorgperson schema]: 
Skipping because of failed dependencies 
And so on for all dependent resources… 
Presented by
systemd is not installed 
The error, Could not find init script for ‘slapd’ is caused by 
a fake systemd in the base centos image 
$ docker run -i -t centos rpm -qa | grep systemd 
fakesystemd-1-15.el7.centos.noarch 
systemd-libs-208-11.el7_0.2.x86_64 
Presented by
Fix #1 Install the real systemd 
Replace fakesystemd with the real deal 
microservice => virtualized os model 
Start a minimum number of services with systemd 
New base image: centos7vps with systemd 
Presented by
Presented by 
Fix #1 Dockerfile 
FROM centos:centos7 
RUN yum -y swap  
-- remove fakesystemd  
-- install systemd systemd-libs 
# RUN rm unit files in /{lib,etc}/systemd/system 
CMD ["/usr/sbin/init"]
Presented by 
Build new base image 
$ docker build -t centos7vps . 
This base image has the real systemd installed.
New Dockerfile 
FROM centos7vps # <= was centos:centos7 
ADD puppet.tar.gz / 
RUN puppet apply -v --modulepath=/puppet/modules  
/puppet/manifests/ldap.pp 
EXPOSE 389 
CMD ["/usr/sbin/init"] 
Presented by
Presented by 
Working for docker run… 
Puppet works inside a running docker container 
systemd is running
Presented by 
Working for docker run… 
Start the systemd container 
$ CID=$(docker run --privileged -d centos7vps) 
Enter the container 
$ sudo /usr/local/bin/docker-enter $CID
Presented by 
Working for docker run… 
Run Puppet: 
bash-4.2# puppet apply /puppet/manifests/ldap.pp 
Compiled catalog for ldap in 1.05 seconds 
Service[slapd]/ensure: 'stopped' => 'running' 
Finished catalog run in 30.15 seconds
Not working for docker build 
systemd is present, but not running during the build phase 
$ docker build -t ldap:vps . 
… 
Error: Could not start Service[slapd]: 
Execution of '/usr/bin/systemctl start slapd' 
returned 1: Failed to get D-Bus connection: 
No connection to service manager. 
Presented by
Moving ahead 
We could stop now and simply run puppet every time the 
container starts prior to the application starting. 
This would increase service start time. 
Application images become mutable, managed by Puppet. 
Doesn’t fit the microservice model very well. 
Presented by
Goal: Puppet configured images 
Puppet configures immutable pre-configured base 
application images 
Immutable images provide known good state 
Closer to the microservice model 
Compatible with the os virtualization model 
Presented by
Docker build with Puppet Try #2 
Override the Service[slapd] to avoid systemd at build time 
class ldap_override inherits openldap::server::service { 
Service[slapd] { 
Presented by 
ensure => running, 
enable => undef, 
start => '/usr/sbin/slapd -u ldap -h "ldapi:/// ldap:///" 
} 
}
Success! 
We’re able to build an immutable application image fully 
configured by Puppet. 
Presented by
Presented by 
LDAP running in systemd 
/usr/bin/docker -d --selinux-enabled 
_ /usr/sbin/init 
_ /usr/lib/systemd/systemd-journald 
_ /bin/dbus-daemon --system 
_ /usr/sbin/slapd -u ldap -h ldapi:/// ldap:///
Moving further ahead 
We could stop here, but there are a number of trade-offs 
systemd requires the container to run in privileged mode 
More processes: systemd, journald, dbus, application 
Slower startup / tear-down time (~5 seconds) 
Still faster than a VM (~30+ seconds) 
Presented by
Presented by 
Final Dockerfile 
FROM centos7vps 
ADD puppet.tar.gz / 
RUN puppet apply -v /puppet/manifests/ldap.pp 
EXPOSE 389 
CMD ["/usr/sbin/slapd", "-u", "ldap",  
"-h", "ldapi:/// ldap:///", "-d", "0"]
Presented by 
Final Dockerfile 
FROM centos7vps 
ADD puppet.tar.gz / 
RUN puppet apply -v /puppet/manifests/ldap.pp 
EXPOSE 389 
CMD ["/usr/sbin/slapd", "-u", "ldap",  
"-h", "ldapi:/// ldap:///", "-d", "0"]
docker build ldap:microservice 
Build is required for deployment 
$ docker build -t ldap:microservice . 
Presented by
Presented by 
Single-process Microservice 
Only one process running in the container: 
/usr/bin/docker -d --selinux-enabled 
_ /usr/sbin/slapd -u ldap -h ldapi:/// ldap:/// -d 0 
Start / Stop time: ~1 second
Puppetized Microservice 
The application image is immutable 
Changes to the application require a new image build 
Centralized reporting via Puppet 
version control via Puppet code 
Re-usable modules from the Puppet forge 
Presented by
Putting it together 
Link the jenkins microservice with the ldap microservice 
$ docker run -d --name ldap ldap:microservice 
$ docker run -d --name jenkins  
--link ldap:ldap  
--publish 18080:8080  
jenkins:microservice 
Presented by
Presented by 
Results 
The application (jenkins) is now isolated 
With isolated dependencies included (ldap) 
The applications are immutable 
Multiple copies can easily be deployed 
Difficult to change running instances
Making a change to LDAP 
Need to modify the LDAP indexes as an optimization 
1: Update Puppet Configuration 
2: Rebuild LDAP image 
3: Re-deploy LDAP 
4: Re-deploy Jenkins (The link to LDAP is static) 
Presented by
Advantages and Disadvantages 
Immutable known good state 
Deployment is highly repeatable and consistent 
App and Dependency are tightly coupled 
Ambassador Pattern decouples services (with tedium) 
Presented by 
!
Summary 
Forge modules are re-usable in Docker containers 
Service resources pose a challenge 
Override the service resource to build immutable images 
Multi-process images with systemd are an option 
Presented by
Presented by 
Thank you! 
Code: 
github.com/jeffmccune/puppetconf2014 
David Lutterkort’s Dockercon talk: 
http://links.puppetlabs.com/lutter-docker 
!

More Related Content

What's hot

Provisioning & Deploying with Docker
Provisioning & Deploying with DockerProvisioning & Deploying with Docker
Provisioning & Deploying with DockerErica Windisch
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
 
Docker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12XDocker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12XJérôme Petazzoni
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using dockerLarry Cai
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesLarry Cai
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Michele Orselli
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Carlos Sanchez
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeSoshi Nemoto
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Michele Orselli
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)Soshi Nemoto
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleRoman Rodomansky
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Bill Maxwell
 
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPuppet
 

What's hot (20)

Provisioning & Deploying with Docker
Provisioning & Deploying with DockerProvisioning & Deploying with Docker
Provisioning & Deploying with Docker
 
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
 
Vagrant
VagrantVagrant
Vagrant
 
Docker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12XDocker and Puppet — Puppet Camp L.A. — SCALE12X
Docker and Puppet — Puppet Camp L.A. — SCALE12X
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Python virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutesPython virtualenv & pip in 90 minutes
Python virtualenv & pip in 90 minutes
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
Infrastructure testing with Jenkins, Puppet and Vagrant - Agile Testing Days ...
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))Vagrant for real codemotion (moar tips! ;-))
Vagrant for real codemotion (moar tips! ;-))
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Docker orchestration
Docker orchestrationDocker orchestration
Docker orchestration
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101
 
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 

Similar to How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf 2014

Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetesWilliam Stewart
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioJérôme Petazzoni
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Chef
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725miguel dominguez
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725MortazaJohari
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Yevgeniy Brikman
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Fabrice Bernhard
 
Docker in Action
Docker in ActionDocker in Action
Docker in ActionAlper Kanat
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerLuong Vo
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...Codemotion
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014Carlo Bonamico
 
[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 Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3kognate
 
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
 

Similar to How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf 2014 (20)

Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
Containers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific TrioContainers, Docker, and Microservices: the Terrific Trio
Containers, Docker, and Microservices: the Terrific Trio
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015Baking Docker Using Chef - ChefConf 2015
Baking Docker Using Chef - ChefConf 2015
 
Docker
DockerDocker
Docker
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
[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 Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
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)
 

More from Puppet

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyamlPuppet
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)Puppet
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscodePuppet
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twentiesPuppet
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codePuppet
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approachPuppet
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationPuppet
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliancePuppet
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowPuppet
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Puppet
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppetPuppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkPuppet
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping groundPuppet
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy SoftwarePuppet
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User GroupPuppet
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsPuppet
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyPuppet
 

More from Puppet (20)

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyaml
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscode
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance code
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approach
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliance
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNow
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden Windows
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael Pinson
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping ground
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User Group
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOps
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
 

Recently uploaded

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Recently uploaded (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf 2014

  • 1. 2014 Presented by How Puppet Enables the Use of Lightweight Virtualized Containers Jeff McCune Software Developer | Puppet Labs @0xEFF
  • 2. What we’ll cover Compare and contrasts a Jenkins+LDAP deployed onto virtual machines and onto lightweight containers. Presented by ! Jenkins and LDAP Puppet Forge Modules Migrating from a shared VM to containers Common Problems with Service Management Summary of Lessons Learned
  • 3. Presented by Starting Point https://github.com/jeffmccune/puppetconf2014 Traditional VM Puppet deploys Jenkins with LDAP security http://sharedvm:18080
  • 4. Presented by Shared VM Vagrant VM Puppet Jenkins OpenLDAP Puppet configures Jenkins and OpenLDAP Vagrant Puppet provisioner
  • 5. Presented by Migrating to Containers Vagrant VM Puppet at runtime Jenkins OpenLDAP Docker Host ! ! OpenLDAP Container Puppet at build ! time ! Jenkins Container Puppet at build time
  • 6. Puppet Forge module re-use It is faster to deploy Jenkins with LDAP using forge modules: rtyler/jenkins module 90% code re-use: 831 lines from the Forge, 88 lines added camptocamp/openldap module 85% code re-use: 584 lines from the Forge, 108 lines added Presented by
  • 7. Presented by Site Specific Customizations Initialize LDAP for dc=jeffmccune,dc=net Configure LDAP admin account and password Load initial schema and base OU’s into LDAP Configure Jenkins to use LDAP security
  • 8. Moving from a VM to a Container Challenges in Puppet: Service resources fail and must be overridden Downstream resources require the service resource LDAP initial schema load requires Service[slapd] Presented by
  • 9. Why do service resources fail? Two different models of containers: Those with and without a service management framework. In either case there is no service management framework running during the image build phase. Presented by
  • 10. Presented by Containers Two Models of Containers: OS Virtualization Model - Heavy (Solaris Zones, FreeBSD Jails, IBM WPAR’s) Microservice Model - Light (Docker, CoreOS, Kubernetes)
  • 11. False Dichotomy over “Light” Weight is a range, not a boolean. Single-process image Multi-process image Full-os image Runtime manageability decreases as processes decrease Presented by
  • 12. Single-process Microservices In general: Executes the application process directly, no init system startup time comparable to normal process startup Puppet does not operate at runtime Difficult to manage with volumes and sidekick processes Presented by
  • 13. Multi-process Microservices In general: Start an init system (SysV init, systemd, upstart) The service management framework manages services Runs ~5 or more processes per container Puppet works at runtime without modification Presented by
  • 14. Full OS Virtualization Containers Run everything a traditional OS would run Dozens of running processes in the container Long startup time (> 30 seconds) Easier to manage at runtime Better for some situations, e.g. mimicking a full running OS Presented by
  • 15. Container Images Microservice containers have a distinct build phase The result of the build step is an image, ideally immutable Instances execute from a built base image The Dockerfile is an example of a build script Presented by
  • 16. Dockerfile FROM centos:centos7 ADD puppet.tar.gz / RUN puppet apply -v --modulepath=/puppet/modules /puppet/manifests/ldap.pp EXPOSE 389 CMD ["/usr/sbin/init"] Presented by
  • 17. Dockerfile FROM centos:centos7 ADD puppet.tar.gz / RUN puppet apply -v --modulepath=/puppet/modules /puppet/manifests/ldap.pp EXPOSE 389 CMD ["/usr/sbin/init"] Presented by
  • 18. Dockerfile FROM centos:centos7 ADD puppet.tar.gz / RUN puppet apply -v --modulepath=/puppet/modules /puppet/manifests/ldap.pp EXPOSE 389 CMD ["/usr/sbin/init"] Presented by
  • 19. Dockerfile FROM centos:centos7 ADD puppet.tar.gz / RUN puppet apply -v --modulepath=/puppet/modules /puppet/manifests/ldap.pp EXPOSE 389 CMD ["/usr/sbin/init"] Presented by
  • 20. Presented by docker build $ docker build --tag base_image . Sending build context to Docker daemon 4.718 MB Step 0 : FROM centos:centos7 ---> 3236320e3562 Step 1 : ADD puppet.tar.gz / ---> bc9aa11de092 Step 2 : RUN puppet apply … ---> Running in efdda7633bfc
  • 21. docker build $ docker build --tag base_image . Sending build context to Docker daemon 4.718 MB Step 0 : FROM centos:centos7 ---> 3236320e3562 Step 1 : ADD puppet.tar.gz / ---> bc9aa11de092 Step 2 : RUN puppet apply … ---> Running in efdda7633bfc Presented by
  • 22. Presented by docker build $ docker build --tag base_image . Sending build context to Docker daemon 4.718 MB Step 0 : FROM centos:centos7 ---> 3236320e3562 Step 1 : ADD puppet.tar.gz / ---> bc9aa11de092 Step 2 : RUN puppet apply … ---> Running in efdda7633bfc
  • 23. Presented by docker build $ docker build --tag base_image . Sending build context to Docker daemon 4.718 MB Step 0 : FROM centos:centos7 ---> 3236320e3562 Step 1 : ADD puppet.tar.gz / ---> bc9aa11de092 Step 2 : RUN puppet apply … ---> Running in efdda7633bfc
  • 24. Docker Build with Puppet Try #1 Error: /Service[slapd]: Could not evaluate: Could not find init script for 'slapd' Warning: Openldap_database[dc=jeffmccune,dc=net]: Skipping because of failed dependencies Warning: Exec[inetorgperson schema]: Skipping because of failed dependencies And so on for all dependent resources… Presented by
  • 25. systemd is not installed The error, Could not find init script for ‘slapd’ is caused by a fake systemd in the base centos image $ docker run -i -t centos rpm -qa | grep systemd fakesystemd-1-15.el7.centos.noarch systemd-libs-208-11.el7_0.2.x86_64 Presented by
  • 26. Fix #1 Install the real systemd Replace fakesystemd with the real deal microservice => virtualized os model Start a minimum number of services with systemd New base image: centos7vps with systemd Presented by
  • 27. Presented by Fix #1 Dockerfile FROM centos:centos7 RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs # RUN rm unit files in /{lib,etc}/systemd/system CMD ["/usr/sbin/init"]
  • 28. Presented by Build new base image $ docker build -t centos7vps . This base image has the real systemd installed.
  • 29. New Dockerfile FROM centos7vps # <= was centos:centos7 ADD puppet.tar.gz / RUN puppet apply -v --modulepath=/puppet/modules /puppet/manifests/ldap.pp EXPOSE 389 CMD ["/usr/sbin/init"] Presented by
  • 30. Presented by Working for docker run… Puppet works inside a running docker container systemd is running
  • 31. Presented by Working for docker run… Start the systemd container $ CID=$(docker run --privileged -d centos7vps) Enter the container $ sudo /usr/local/bin/docker-enter $CID
  • 32. Presented by Working for docker run… Run Puppet: bash-4.2# puppet apply /puppet/manifests/ldap.pp Compiled catalog for ldap in 1.05 seconds Service[slapd]/ensure: 'stopped' => 'running' Finished catalog run in 30.15 seconds
  • 33. Not working for docker build systemd is present, but not running during the build phase $ docker build -t ldap:vps . … Error: Could not start Service[slapd]: Execution of '/usr/bin/systemctl start slapd' returned 1: Failed to get D-Bus connection: No connection to service manager. Presented by
  • 34. Moving ahead We could stop now and simply run puppet every time the container starts prior to the application starting. This would increase service start time. Application images become mutable, managed by Puppet. Doesn’t fit the microservice model very well. Presented by
  • 35. Goal: Puppet configured images Puppet configures immutable pre-configured base application images Immutable images provide known good state Closer to the microservice model Compatible with the os virtualization model Presented by
  • 36. Docker build with Puppet Try #2 Override the Service[slapd] to avoid systemd at build time class ldap_override inherits openldap::server::service { Service[slapd] { Presented by ensure => running, enable => undef, start => '/usr/sbin/slapd -u ldap -h "ldapi:/// ldap:///" } }
  • 37. Success! We’re able to build an immutable application image fully configured by Puppet. Presented by
  • 38. Presented by LDAP running in systemd /usr/bin/docker -d --selinux-enabled _ /usr/sbin/init _ /usr/lib/systemd/systemd-journald _ /bin/dbus-daemon --system _ /usr/sbin/slapd -u ldap -h ldapi:/// ldap:///
  • 39. Moving further ahead We could stop here, but there are a number of trade-offs systemd requires the container to run in privileged mode More processes: systemd, journald, dbus, application Slower startup / tear-down time (~5 seconds) Still faster than a VM (~30+ seconds) Presented by
  • 40. Presented by Final Dockerfile FROM centos7vps ADD puppet.tar.gz / RUN puppet apply -v /puppet/manifests/ldap.pp EXPOSE 389 CMD ["/usr/sbin/slapd", "-u", "ldap", "-h", "ldapi:/// ldap:///", "-d", "0"]
  • 41. Presented by Final Dockerfile FROM centos7vps ADD puppet.tar.gz / RUN puppet apply -v /puppet/manifests/ldap.pp EXPOSE 389 CMD ["/usr/sbin/slapd", "-u", "ldap", "-h", "ldapi:/// ldap:///", "-d", "0"]
  • 42. docker build ldap:microservice Build is required for deployment $ docker build -t ldap:microservice . Presented by
  • 43. Presented by Single-process Microservice Only one process running in the container: /usr/bin/docker -d --selinux-enabled _ /usr/sbin/slapd -u ldap -h ldapi:/// ldap:/// -d 0 Start / Stop time: ~1 second
  • 44. Puppetized Microservice The application image is immutable Changes to the application require a new image build Centralized reporting via Puppet version control via Puppet code Re-usable modules from the Puppet forge Presented by
  • 45. Putting it together Link the jenkins microservice with the ldap microservice $ docker run -d --name ldap ldap:microservice $ docker run -d --name jenkins --link ldap:ldap --publish 18080:8080 jenkins:microservice Presented by
  • 46. Presented by Results The application (jenkins) is now isolated With isolated dependencies included (ldap) The applications are immutable Multiple copies can easily be deployed Difficult to change running instances
  • 47. Making a change to LDAP Need to modify the LDAP indexes as an optimization 1: Update Puppet Configuration 2: Rebuild LDAP image 3: Re-deploy LDAP 4: Re-deploy Jenkins (The link to LDAP is static) Presented by
  • 48. Advantages and Disadvantages Immutable known good state Deployment is highly repeatable and consistent App and Dependency are tightly coupled Ambassador Pattern decouples services (with tedium) Presented by !
  • 49. Summary Forge modules are re-usable in Docker containers Service resources pose a challenge Override the service resource to build immutable images Multi-process images with systemd are an option Presented by
  • 50. Presented by Thank you! Code: github.com/jeffmccune/puppetconf2014 David Lutterkort’s Dockercon talk: http://links.puppetlabs.com/lutter-docker !