SlideShare a Scribd company logo
1 of 41
Download to read offline
Puppet at Opera
      Puppet Camp Oslo 2013
            cosimo@opera.com
devs   sysadmin
devs   sysadmin




  DevSys?
FDD
Frustration Driven Development
# LVS main config file
#
# Last modified:
#    2012-12-10 Commented out all wlb servers, as they haven't been in use …
#    2012-XX-XX Tons of shifting around servers, upgrading and problems (Everyone)
#    2011-04-01 Removed all old b#-servers (N.....)
#    2010-03-24 Bye bye bigma. (M..../Cosimo)
#    2010-03-03 Restore pre Feb 26th config that seems to ensure stability (Cosimo)
#                When adding bigboy/bigcat, bad site lockups happen
#    2010-03-03 Reducing weight on b12 as it is less powerfull (M....)
#    2010-02-26 re-adding bigdog, and lowering bigunc, also vamping up b12 to 100%
#    2010-02-26 Bigdog is crashing, removing from lvs (M......)
#    2010-02-03 Enabled f8 and b7, first b7, then some hours later f8 … (N......)
#    2010-01-19 Bigant ready to rock and roll! (Cosimo)
#    2010-01-13 Removed bigpa, fatgirl from database pool (Cosimo)
#    2010-01-07 Added b8 to backend pool (Cosimo)
#    2010-01-05 Added bigant to the My Opera databases (Cosimo)
#    2009-11-22 Added bigdog to the My Opera databases (Cosimo)
#    2009-11-18 Added b7 and f8 as back-end servers (M.....)
#    2009-11-18 Removed p23-02 backend, moved to auth (Cosimo)
#    2009-11-12 Removing b7 and f8 from Mysql Load balancers (Cosimo)
#    2009-11-11 Added Lenny backend p23-02 (Cosimo)
#    2009-10-11 phased-in InnoDB-powered bigma in production (Cosimo)
#    2009-09-23 phased-in InnoDB-powered bigma in production (Cosimo)
#    2009-06-27 switched master from bigma to bigsis (w-mlb) o/ (N.....)
#    2009-06-23 shifting load away from bigbro. it's dying? (Cosimo)
#    2009-03-18 pushing bigbro as much as we can, to test it out (Cosimo)
global_defs {
    lvs_id MY_LVS
    …
}
innodb_buffer_pool_size = 128M
        # was 64M # was 16M # was 32M
The Pilot – Goals


●
    New deployment procedure

●
    Sane configuration files

●
    Configuration management
CM Tools Evaluation (2009)


  CFEngine 2
  BCfg2
  Puppet 0.25.4
  LCFG
CM Tools Evaluation


  CFEngine 2
  BCfg2
  Puppet 0.25.4 → 2.6.2 → 2.7.14
  LCFG
The very beginning...

commit 9c54321f51bf969940b63b48d055743ac504035e
Author: Cosimo Streppone <cosimo@opera.com>
Date:   Thu Jan 14 13:21:40 2010 +0000
    Generic puppet recipes. To be continued.
Our approach
A “conservative” approach, surely

 • Keep it simple. No concat/append/modify

 • As few dependencies as possible

 • Stability and reliability is critical

 • No pulls from github or external URLs

 • We don't use puppet for deployment

 • Even realize() gets me into panic mode
Three Years In

•   Modules repository, with 60+ mods
•   Some custom facter plugins
•   Shared projects conventions & structure
•   Shared deployment procedures and libs
•   Good server baseline configuration
•   Our team, ~200 nodes
•   Opera Mini Ops team, thousands of nodes
Datacenters
It's Modules all the way down...

               Tomcat                base_packages
      Apache                                             PowerDNS
                          Bash
                 Statsd                           Munin
Postfix                          Cassandra
           security_upgrades            Ssh             RRDCached
      Django
                          Solr 4.0
               RabbitMQ                       Varnish
Projects structure


Master config file    /config/production.json

Role-specific files   /config/role/<role>/

Puppet manifests      /config/puppet/

Deployment scripts /deploy/
Master configuration file
{   "master_rev"    :   "20130129",
    "application"   :   "geodns",
    "environment"   :   "production",
    "domain"        :   "localdomain",
    "contact"       :   "cosimo@opera.com",
    "puppet_vars" : { # Available in manifests
      "some-password" : "hola/amigos" },
    "systems" : {      # List of all hostnames and their roles
      "node01" : {
         "puppet_class" : [ "geodns::backend" ]
      },
      "node02" : {
         "puppet_class" : [ "geodns::frontend" ],
         "puppet_vars" : { … },
      },
      …
    }
Puppet master layout
/etc/puppet →

   puppet.conf                 (master configuration file)


   fileserver.conf
   files →
       {auth, geodns, opcdn}            (local project files)


   modules →             (shared generic modules)
       {ntp, apache, varnish, nginx, ...}

   manifests →              (generic and project specific manifests)
       classes/
           {basenode, backend, frontend}.pp
       classes/ <project> /
           <anything goes, project-specific>
Puppet master - site.pp

 /etc/puppet/manifests/site.pp

  $server = "puppetmaster.opera.com"
  import "os/*.pp"
  import "classes/*.pp"        # generic classes
  import "classes/*/*.pp"      # project classes
  node default { include basenode }
  filebucket { "main": server => $server }
  File {
      ignore => ['.svn', '.git', 'CVS' ],
      backup => "main",
  }
Puppet master – no nodes.pp

/etc/puppet/puppet.conf

  external_nodes = /etc/puppet/bin/puppet-node-classifier
  node_terminus = exec

/etc/puppet/manifests/nodes/geodns-production.json
  { "application" : "geodns",
    "environment" : "production",
    "domain" : "localdomain",
    "systems" : {
        "node01" : {
             "puppet_class" : [ "geodns::backend" ],
        }, …
    }
  }
Facter
  $ facter --puppet
  architecture => amd64
  datacenter => nerv
  domain => opera.com
  facterversion => 1.5.7
  fqdn => node01.int.opera.com
  hardwareisa => unknown
  hardwaremodel => x86_64
  hostname => node01
  id => root
  interfaces => eth0,eth1
  ipaddress => 1.2.3.4
  ipaddress_eth0 => 1.2.3.4
  …
Facter – custom plugins

 facter/datacenter.rb

 Facter.add("datacenter") do
     setcode do
         datacenter = "unknown"
         # Get current ip address from Facter's own db
         ipaddr = Facter.value(:ipaddress)
         if ipaddr.match("^1.2.3.")
             datacenter = "dc1"
         elsif ipaddr.match(...)
         …
         end
     end
 end
Facter – custom plugins

 case $datacenter   {
     "dc1" :    {   include opera::datacenters::dc1 }
     "dc2" :    {   include opera::datacenters::dc2 }
     "dc3" :    {   include opera::datacenters::dc3 }
     …
     default:   {   include opera::datacenters::base }
 }
Basenode class
 class basenode {

     include opera

     # Opera-specific data-center based settings
     case $datacenter {
         "dc1" : { include opera::datacenters::dc1 }
         …
         default: { include opera::datacenters::base }
     }

     include   apt-opera
     include   base_packages
     include   locales
     include   logcheck
     include   munin
     include   nagios
     include   cron
     include   perl
     include   python
     include   puppet
     include   ntp
     include   timezone
     …
 }
Bootstrap script


    autosign
  + some preinstalled packages
  + internal apt repository
  + a bit of shell scripting
Real world examples – 1 Project
   class geodns::backend {

       include   opera::admins::devops
       include   security-upgrades
       include   powerdns
       include   geoip::city
       include   memcache

       package { [ 'libjson-xs-perl', … ]:
         ensure => 'present'
       }

       bash::prompt { '/root/.bashrc':
         description => 'geodns', color => 'red',
       }

       munin::plugin::custom { 'geodns_': }
       munin::plugin {
         [ 'geodns_country', 'geodns_errors', … ]:
         plugin_name => 'geodns_',
       }
   }
Real world examples – 2 Varnish
 varnish::config { "project-varnish-config":

     vcl_conf => "tvstore.vcl",
     storage_type => "malloc",
     storage_size => "512M",
     listen_port => 8100,
     sess_workspace => 131072,
     ttl => 60,
     thread_pools => 2,
     thread_min => 400,
     thread_max => 3000,

    # Needed for GeoIP support in varnish:
    # http://stackoverflow.com/questions/5906603/
    cc_command => "exec cc -fpic -shared -Wl,-x 
 -L/usr/include/GeoIP.h -lGeoIP -o %o %s"
 }
Real world examples – 3 Munin

 include munin::server

 file { '/etc/munin/munin-conf.d/project-settings.conf':
    …
 }
Real world examples – 4 Solr

 include solr4

 solr4::core { 'core1':
   config     => '.../core1/solrconfig.xml',
   properties => '.../core1/solrcore.properties',
   schema     => '.../core1/schema.xml',
 }

 solr4::config { 'solr-search-config':
   cores => ['core1', … ],
 }
Pain points AKA wish-list
Speed!


   ~60 s runtime → ~600 resources

            TOO SLOW!
Resources that don't go away


notice: /Stage[main]/Django/Package[Django]/ensure:
    ensure changed '1.4.3' to '1.4.2'

notice: /Stage[main]/Package[cython]/ensure:
    created

notice: /Stage[main]/Java::Sun_java6/Exec[debconf-set-selections-sun-java6-bin]
    /returns: executed successfully

notice: /Stage[main]/Java::Sun_java6/Exec[debconf-set-selections-sun-java6-jre]
    /returns: executed successfully
Shared resources


        cron::logcleanup { … }

 • Used by both Apache and Nginx modules
 • Getting conflicts if you pull both
Shared environment


Many projects run under the same master.

A syntax error anywhere blocks everyone.
Testing


     Would be awesome to be able
   to test our modules and manifests.

                  Locally.

          Without a puppetmaster.
Future directions
Things we'd like to look into...


  • PuppetDB

  • Better systems inventory

  • Better Nagios integration

  • Testing manifests and modules
Q&A
@cstrep
                    cosimo@opera.com
            https://github.com/cosimo/
http://w w w.streppone.it/cosimo/blog/

More Related Content

What's hot

DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)Soshi Nemoto
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetWalter Heck
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Workhorse Computing
 
Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Puppet
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksCarlos Sanchez
 
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기raccoony
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Puppet
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricksbcoca
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmusBram Vogelaar
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteBram Vogelaar
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.Graham Dumpleton
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013grim_radical
 
Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Łukasz Proszek
 

What's hot (19)

DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.Shared Object images in Docker: What you need is what you want.
Shared Object images in Docker: What you need is what you want.
 
Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013Using Puppet to Create a Dynamic Network - PuppetConf 2013
Using Puppet to Create a Dynamic Network - PuppetConf 2013
 
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero ClicksHow to Develop Puppet Modules: From Source to the Forge With Zero Clicks
How to Develop Puppet Modules: From Source to the Forge With Zero Clicks
 
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
More tips n tricks
More tips n tricksMore tips n tricks
More tips n tricks
 
Puppet fundamentals
Puppet fundamentalsPuppet fundamentals
Puppet fundamentals
 
Testing your infrastructure with litmus
Testing your infrastructure with litmusTesting your infrastructure with litmus
Testing your infrastructure with litmus
 
Anatomy of a reusable module
Anatomy of a reusable moduleAnatomy of a reusable module
Anatomy of a reusable module
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Intro to-puppet
Intro to-puppetIntro to-puppet
Intro to-puppet
 
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
PyCon AU 2010 - Getting Started With Apache/mod_wsgi.
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.
 

Similar to Puppet at Opera Sofware - PuppetCamp Oslo 2013

Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardwayDave Pitts
 
Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Halil Kaya
 
BDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part IIBDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part IIDavid Lauzon
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStackPuppet
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackke4qqq
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on DockerDaniel Ku
 
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Zabbix
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpresoke4qqq
 
containerit at useR!2017 conference, Brussels
containerit at useR!2017 conference, Brusselscontainerit at useR!2017 conference, Brussels
containerit at useR!2017 conference, BrusselsDaniel Nüst
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStackke4qqq
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOpsОмские ИТ-субботники
 
Easy deployment & management of cloud apps
Easy deployment & management of cloud appsEasy deployment & management of cloud apps
Easy deployment & management of cloud appsDavid Cunningham
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
[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
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsMichael Lange
 

Similar to Puppet at Opera Sofware - PuppetCamp Oslo 2013 (20)

Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36Infrastructure as code - Python Saati #36
Infrastructure as code - Python Saati #36
 
BDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part IIBDM32: AdamCloud Project - Part II
BDM32: AdamCloud Project - Part II
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on Docker
 
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
Erik Skytthe - Monitoring Mesos, Docker, Containers with Zabbix | ZabConf2016
 
Discovering OpenBSD on AWS
Discovering OpenBSD on AWSDiscovering OpenBSD on AWS
Discovering OpenBSD on AWS
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
 
containerit at useR!2017 conference, Brussels
containerit at useR!2017 conference, Brusselscontainerit at useR!2017 conference, Brussels
containerit at useR!2017 conference, Brussels
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Easy deployment & management of cloud apps
Easy deployment & management of cloud appsEasy deployment & management of cloud apps
Easy deployment & management of cloud apps
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
[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
 
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other ThingsI Just Want to Run My Code: Waypoint, Nomad, and Other Things
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
 

More from Cosimo Streppone

Velocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayVelocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayCosimo Streppone
 
Velocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackVelocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackCosimo Streppone
 
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn'tMojolicious: what works and what doesn't
Mojolicious: what works and what doesn'tCosimo Streppone
 
Surge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.comSurge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.comCosimo Streppone
 
My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009Cosimo Streppone
 
YAPC::EU::2009 - How Opera Software uses Perl
YAPC::EU::2009 - How Opera Software uses PerlYAPC::EU::2009 - How Opera Software uses Perl
YAPC::EU::2009 - How Opera Software uses PerlCosimo Streppone
 
NPW2009 - my.opera.com scalability v2.0
NPW2009 - my.opera.com scalability v2.0NPW2009 - my.opera.com scalability v2.0
NPW2009 - my.opera.com scalability v2.0Cosimo Streppone
 
IPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityIPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityCosimo Streppone
 

More from Cosimo Streppone (9)

Velocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard WayVelocity 2012 - Learning WebOps the Hard Way
Velocity 2012 - Learning WebOps the Hard Way
 
Italian, do you speak it?
Italian, do you speak it?Italian, do you speak it?
Italian, do you speak it?
 
Velocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attackVelocity 2011 - Our first DDoS attack
Velocity 2011 - Our first DDoS attack
 
Mojolicious: what works and what doesn't
Mojolicious: what works and what doesn'tMojolicious: what works and what doesn't
Mojolicious: what works and what doesn't
 
Surge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.comSurge 2010 - from disaster to stability - scaling my.opera.com
Surge 2010 - from disaster to stability - scaling my.opera.com
 
My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009My Opera meets Varnish, Dec 2009
My Opera meets Varnish, Dec 2009
 
YAPC::EU::2009 - How Opera Software uses Perl
YAPC::EU::2009 - How Opera Software uses PerlYAPC::EU::2009 - How Opera Software uses Perl
YAPC::EU::2009 - How Opera Software uses Perl
 
NPW2009 - my.opera.com scalability v2.0
NPW2009 - my.opera.com scalability v2.0NPW2009 - my.opera.com scalability v2.0
NPW2009 - my.opera.com scalability v2.0
 
IPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalabilityIPW2008 - my.opera.com scalability
IPW2008 - my.opera.com scalability
 

Recently uploaded

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Recently uploaded (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 

Puppet at Opera Sofware - PuppetCamp Oslo 2013

  • 1. Puppet at Opera Puppet Camp Oslo 2013 cosimo@opera.com
  • 2. devs sysadmin
  • 3. devs sysadmin DevSys?
  • 4.
  • 6. # LVS main config file # # Last modified: # 2012-12-10 Commented out all wlb servers, as they haven't been in use … # 2012-XX-XX Tons of shifting around servers, upgrading and problems (Everyone) # 2011-04-01 Removed all old b#-servers (N.....) # 2010-03-24 Bye bye bigma. (M..../Cosimo) # 2010-03-03 Restore pre Feb 26th config that seems to ensure stability (Cosimo) # When adding bigboy/bigcat, bad site lockups happen # 2010-03-03 Reducing weight on b12 as it is less powerfull (M....) # 2010-02-26 re-adding bigdog, and lowering bigunc, also vamping up b12 to 100% # 2010-02-26 Bigdog is crashing, removing from lvs (M......) # 2010-02-03 Enabled f8 and b7, first b7, then some hours later f8 … (N......) # 2010-01-19 Bigant ready to rock and roll! (Cosimo) # 2010-01-13 Removed bigpa, fatgirl from database pool (Cosimo) # 2010-01-07 Added b8 to backend pool (Cosimo) # 2010-01-05 Added bigant to the My Opera databases (Cosimo) # 2009-11-22 Added bigdog to the My Opera databases (Cosimo) # 2009-11-18 Added b7 and f8 as back-end servers (M.....) # 2009-11-18 Removed p23-02 backend, moved to auth (Cosimo) # 2009-11-12 Removing b7 and f8 from Mysql Load balancers (Cosimo) # 2009-11-11 Added Lenny backend p23-02 (Cosimo) # 2009-10-11 phased-in InnoDB-powered bigma in production (Cosimo) # 2009-09-23 phased-in InnoDB-powered bigma in production (Cosimo) # 2009-06-27 switched master from bigma to bigsis (w-mlb) o/ (N.....) # 2009-06-23 shifting load away from bigbro. it's dying? (Cosimo) # 2009-03-18 pushing bigbro as much as we can, to test it out (Cosimo) global_defs { lvs_id MY_LVS … }
  • 7. innodb_buffer_pool_size = 128M # was 64M # was 16M # was 32M
  • 8. The Pilot – Goals ● New deployment procedure ● Sane configuration files ● Configuration management
  • 9. CM Tools Evaluation (2009) CFEngine 2 BCfg2 Puppet 0.25.4 LCFG
  • 10. CM Tools Evaluation CFEngine 2 BCfg2 Puppet 0.25.4 → 2.6.2 → 2.7.14 LCFG
  • 11. The very beginning... commit 9c54321f51bf969940b63b48d055743ac504035e Author: Cosimo Streppone <cosimo@opera.com> Date: Thu Jan 14 13:21:40 2010 +0000 Generic puppet recipes. To be continued.
  • 13. A “conservative” approach, surely • Keep it simple. No concat/append/modify • As few dependencies as possible • Stability and reliability is critical • No pulls from github or external URLs • We don't use puppet for deployment • Even realize() gets me into panic mode
  • 14. Three Years In • Modules repository, with 60+ mods • Some custom facter plugins • Shared projects conventions & structure • Shared deployment procedures and libs • Good server baseline configuration • Our team, ~200 nodes • Opera Mini Ops team, thousands of nodes
  • 16. It's Modules all the way down... Tomcat base_packages Apache PowerDNS Bash Statsd Munin Postfix Cassandra security_upgrades Ssh RRDCached Django Solr 4.0 RabbitMQ Varnish
  • 17.
  • 18. Projects structure Master config file /config/production.json Role-specific files /config/role/<role>/ Puppet manifests /config/puppet/ Deployment scripts /deploy/
  • 19. Master configuration file { "master_rev" : "20130129", "application" : "geodns", "environment" : "production", "domain" : "localdomain", "contact" : "cosimo@opera.com", "puppet_vars" : { # Available in manifests "some-password" : "hola/amigos" }, "systems" : { # List of all hostnames and their roles "node01" : { "puppet_class" : [ "geodns::backend" ] }, "node02" : { "puppet_class" : [ "geodns::frontend" ], "puppet_vars" : { … }, }, … }
  • 20. Puppet master layout /etc/puppet → puppet.conf (master configuration file) fileserver.conf files → {auth, geodns, opcdn} (local project files) modules → (shared generic modules) {ntp, apache, varnish, nginx, ...} manifests → (generic and project specific manifests) classes/ {basenode, backend, frontend}.pp classes/ <project> / <anything goes, project-specific>
  • 21. Puppet master - site.pp /etc/puppet/manifests/site.pp $server = "puppetmaster.opera.com" import "os/*.pp" import "classes/*.pp" # generic classes import "classes/*/*.pp" # project classes node default { include basenode } filebucket { "main": server => $server } File { ignore => ['.svn', '.git', 'CVS' ], backup => "main", }
  • 22. Puppet master – no nodes.pp /etc/puppet/puppet.conf external_nodes = /etc/puppet/bin/puppet-node-classifier node_terminus = exec /etc/puppet/manifests/nodes/geodns-production.json { "application" : "geodns", "environment" : "production", "domain" : "localdomain", "systems" : { "node01" : { "puppet_class" : [ "geodns::backend" ], }, … } }
  • 23. Facter $ facter --puppet architecture => amd64 datacenter => nerv domain => opera.com facterversion => 1.5.7 fqdn => node01.int.opera.com hardwareisa => unknown hardwaremodel => x86_64 hostname => node01 id => root interfaces => eth0,eth1 ipaddress => 1.2.3.4 ipaddress_eth0 => 1.2.3.4 …
  • 24. Facter – custom plugins facter/datacenter.rb Facter.add("datacenter") do setcode do datacenter = "unknown" # Get current ip address from Facter's own db ipaddr = Facter.value(:ipaddress) if ipaddr.match("^1.2.3.") datacenter = "dc1" elsif ipaddr.match(...) … end end end
  • 25. Facter – custom plugins case $datacenter { "dc1" : { include opera::datacenters::dc1 } "dc2" : { include opera::datacenters::dc2 } "dc3" : { include opera::datacenters::dc3 } … default: { include opera::datacenters::base } }
  • 26. Basenode class class basenode { include opera # Opera-specific data-center based settings case $datacenter { "dc1" : { include opera::datacenters::dc1 } … default: { include opera::datacenters::base } } include apt-opera include base_packages include locales include logcheck include munin include nagios include cron include perl include python include puppet include ntp include timezone … }
  • 27. Bootstrap script autosign + some preinstalled packages + internal apt repository + a bit of shell scripting
  • 28. Real world examples – 1 Project class geodns::backend { include opera::admins::devops include security-upgrades include powerdns include geoip::city include memcache package { [ 'libjson-xs-perl', … ]: ensure => 'present' } bash::prompt { '/root/.bashrc': description => 'geodns', color => 'red', } munin::plugin::custom { 'geodns_': } munin::plugin { [ 'geodns_country', 'geodns_errors', … ]: plugin_name => 'geodns_', } }
  • 29. Real world examples – 2 Varnish varnish::config { "project-varnish-config": vcl_conf => "tvstore.vcl", storage_type => "malloc", storage_size => "512M", listen_port => 8100, sess_workspace => 131072, ttl => 60, thread_pools => 2, thread_min => 400, thread_max => 3000, # Needed for GeoIP support in varnish: # http://stackoverflow.com/questions/5906603/ cc_command => "exec cc -fpic -shared -Wl,-x -L/usr/include/GeoIP.h -lGeoIP -o %o %s" }
  • 30. Real world examples – 3 Munin include munin::server file { '/etc/munin/munin-conf.d/project-settings.conf': … }
  • 31. Real world examples – 4 Solr include solr4 solr4::core { 'core1': config => '.../core1/solrconfig.xml', properties => '.../core1/solrcore.properties', schema => '.../core1/schema.xml', } solr4::config { 'solr-search-config': cores => ['core1', … ], }
  • 32. Pain points AKA wish-list
  • 33. Speed! ~60 s runtime → ~600 resources TOO SLOW!
  • 34. Resources that don't go away notice: /Stage[main]/Django/Package[Django]/ensure: ensure changed '1.4.3' to '1.4.2' notice: /Stage[main]/Package[cython]/ensure: created notice: /Stage[main]/Java::Sun_java6/Exec[debconf-set-selections-sun-java6-bin] /returns: executed successfully notice: /Stage[main]/Java::Sun_java6/Exec[debconf-set-selections-sun-java6-jre] /returns: executed successfully
  • 35. Shared resources cron::logcleanup { … } • Used by both Apache and Nginx modules • Getting conflicts if you pull both
  • 36. Shared environment Many projects run under the same master. A syntax error anywhere blocks everyone.
  • 37. Testing Would be awesome to be able to test our modules and manifests. Locally. Without a puppetmaster.
  • 39. Things we'd like to look into... • PuppetDB • Better systems inventory • Better Nagios integration • Testing manifests and modules
  • 40. Q&A
  • 41. @cstrep cosimo@opera.com https://github.com/cosimo/ http://w w w.streppone.it/cosimo/blog/