Talk from Puppet Camp Paris 2015 by Nicolas Brousse and Julien Fabre, presenting a Continuous Delivery workflow used by the Operations Teams that allowed them to do over 10,000 puppet changes deployment in 2014.
branding • Over 27 Billions Ads served in 2014 • Over 30 Billions Ad Auctions per day • Bid processed in less than 50 ms • Bid served in less than 80 ms (include network round trip) • 5 PB of monthly video traffic served • 1.1 EB of data stored Operations Engineering • Ensure the smooth day to day operation of the platform infrastructure • Provide a cost effective and cutting edge infrastructure • Team composed of SREs, SEs and DBAs • Managing over 2,500 servers (virtual and physical)
templates. • 2010: Managing about 250 instances. Start looking at Puppet. • 2011: Started with Puppet 0.25 then upgraded to 2.7 by EOY on 400 servers with 2 contributors. • 2012: 800 servers managed by Puppet. 4 contributors. • 2013: 1,000 servers managed by Puppet. 6 contributors. • 2014: 1,500 servers managed by Puppet. Workflow using Git, Gerrit and Jenkins. 9 contributors. Start migration to 3.7. • 2015: 2,000 servers managed by Puppet. 13 contributors. Five Years Of Puppet!
Building AWS AMI with Packer : Master mode • Local development environment with Vagrant : Master mode • OpenStack deployment : Masterless mode Where and how do we use Puppet ?
manifests and hiera data • 1 job for the Puppet fileserver • 1 job to deploy Continuous Delivery with Jenkins Global Jenkins stats for the past year • ~10,000 Puppet deployment • Over 8,500 Production App Deployment
node manifests (*.pp) • Modules deployed by branch with Git submodules All the data in Hiera • Try to avoid params.pp class • Store everything : modules parameters, classes, keys, passwords, ...
secret files • Easy to add/delete team members • No need to change your Puppet code ! # modules/${modules_name}/files/credentials.yaml.gpg file { ‘/etc/app/credentials.yaml’: ensure => ‘file’, owner => ‘root’, group => ‘root’, mode => ‘0644’, source => ‘puppet:///modules/${module_name}/credentials.yaml’ }
commit (SRE, SE) • Review and validation is done only by a SRE • Jenkins will verify the code but will not validate the commit • Static Puppet environments • Rely a lot on server hostnames
Git submodules anymore ! : - ) • Easy to reproduce any environment • Can use private and forge Puppet modules • Can use branches and tags • Based on Puppetfile Puppet Workflow Reloaded!
'pdxcat/collectd' mod 'puppetlabs/rabbitmq' mod 'arioch/redis' mod 'maestrodev/wget' mod 'puppetlabs/apt' mod 'puppetlabs/stdlib' # Tubemogul modules mod "hosts", :git => 'ssh://<gerrit_host>/puppet/modules/hosts', :branch => 'dev' mod "timezone", :git => 'ssh://<gerrit_host>/puppet/modules/timezone', :branch => 'dev' ...
• Represent the business logic : Roles o Highest abstraction layer o Use Profiles for implementation • Implement the applications : Profiles o Remove potential code duplication o Use modules and other Puppet resources
Puppet code • Allow everyone to review a Puppet change (+1) • Allow SE and SRE to validate a Puppet change (+2) • Auto validation/merging in dev if at least 80% of test (+2)