Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Automating Docker Containers with Puppet
Search
Kylo Ginsberg
October 13, 2014
0
38
Automating Docker Containers with Puppet
Automating Docker Containers with Puppet, 2014-10-13.
Kylo Ginsberg
October 13, 2014
Tweet
Share
More Decks by Kylo Ginsberg
See All by Kylo Ginsberg
Under the Hood - C++ at Puppet Labs
kylog
0
320
Puppet Client: Puppet 4 and Beyond
kylog
0
37
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Producing Creativity
orderedlist
PRO
338
39k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
242
1.2M
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
15
1.6k
Writing Fast Ruby
sferik
622
60k
Debugging Ruby Performance
tmm1
70
11k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
9
1.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
In The Pink: A Labor of Love
frogandcode
138
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Transcript
Automating Docker Containers with Puppet Kylo Ginsberg
[email protected]
@kylog irc:
kylo
Puppet?
So you can write: package { ‘ntp’:! ensure => installed,!
}! file { ‘/etc/ntp.conf’:! ensure => file,! source => ‘/root/example/ntp.conf’,! mode => ‘0444’,! }! service { ‘ntp’:! ensure => running,! }
Forge
Instead write include ‘::ntp' or customize: class { '::ntp':! servers
=> [ 'ntp1.corp.com', 'ntp2.corp.com' ],! }
Puppet System Configuration Declarative Language Resource Abstraction
Two ways to run code: puppet apply puppet agent
Docker and Puppet 1. Building containers! 2. Running containers! 3.
Running inside containers
Building: puppet apply FROM ubuntu:14.04 ! RUN apt-get -y update
RUN apt-get -y install ruby RUN gem install puppet RUN puppet module install puppetlabs/ntp RUN puppet apply -e 'include "::ntp"'
Building: puppet agent FROM ubuntu:14.04 ! RUN apt-get -y update
RUN apt-get -y install ruby RUN gem install puppet RUN puppet agent -t —server my_host
Building: puppet apply FROM jamtur01/puppetbase MAINTAINER James Turnbull "
[email protected]
" !
RUN apt-get -y -q install wget git-core 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"]
System?
Running docker with puppet docker::run { 'helloworld': image => 'ubuntu:precise',
command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"', }
Puppet Agent on a Container?
Container == VM ?
Puppet Agent on a Container? Only if you’re treating it
as a VM
Container == PID? No syslogd, no sshd, no puppet agent
Container == PID?
Bye
Idempotence The state looked like this I ran the function
again The state looked like this