Google compute presentation puppet conf

998 views

Published on

Google Compute presentation

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
998
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
24
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Google compute presentation puppet conf

  1. 1. Puppetized Application Stackswith GCE Dan Bode| Puppet Labs dan@puppetlabs.com
  2. 2. What is a resource ? http://www.sharepointblog.co.uk/tag/bamasterclass/ # puppetconf # puppetize @ puppetlabs
  3. 3. Puppet Resources Simple way to describe the configuration state of individual elements of the system being managed. user { ‘dan’: ensure => present, shell => ‘/bin/bash’, } # puppetconf # puppetize @ puppetlabs
  4. 4. Puppet Resources user { ‘dan’: # a user named dan ensure => present, # should exist shell => ‘/bin/bash’, # with this shell } # puppetconf # puppetize @ puppetlabs
  5. 5. Puppet Resourcespackage { ‘apache2’: # a package named apache2 ensure => present, # should be installed} # puppetconf # puppetize @ puppetlabs
  6. 6. Puppet DSL and Resources http://dustrucshin.deviantart.com/art/Lego-Rainbow-170415743# puppetconf # puppetize @ puppetlabs
  7. 7. Puppet DSL and ResourcesThe Puppet DSL can be used to compose collections ofsimple resources into classes or defined resources. # puppetconf # puppetize @ puppetlabs
  8. 8. Common Pattern: Package, File, Serviceclass webserver { package { ‘apache2’: ensure => present, } file { ‘/etc/apache2/apache2.conf’: content => template(‘apache2/apache2.erb’), require => Package[‘apache2’], } service { ‘apache2’: ensure => running subscribe => File[‘/etc/apache2/apache2.conf’] }} # puppetconf # puppetize @ puppetlabs
  9. 9. Package, File, ServiceNow we can build webservers with: node my_node { include webserver } # puppetconf # puppetize @ puppetlabs
  10. 10. Text is Awesome http://cwd.co.uk/asciimoo/view/29# puppetconf # puppetize @ puppetlabs
  11. 11. Text is awesome • Integrates with version control • Easy to share and collaborate on • Easy to re-use. # puppetconf # puppetize @ puppetlabs
  12. 12. Resources redefined:Anything whose state can be managed on our systemcan be expressed as a resource. # puppetconf # puppetize @ puppetlabs
  13. 13. Puppet DevicesResource can now describe objects on othersystems. # puppetconf # puppetize @ puppetlabs
  14. 14. Google Compute Engine Express stacks as: •VM Instances •Networks •Firewalls •Disks # puppetconf # puppetize @ puppetlabs
  15. 15. GCE objects as resources? • All GCE objects have state (they can exist, not exist) • GCE objects can be managed remotely using the Puppet Device Pattern # puppetconf # puppetize @ puppetlabs
  16. 16. gce_disk { ‘dansdisk’: ensure => present, size_gb => 2,} # puppetconf # puppetize @ puppetlabs
  17. 17. gce_network { ‘dansnetwork’: ensure => present, gateway => 10.0.1.1, range => 10.0.1.0/24’,} # puppetconf # puppetize @ puppetlabs
  18. 18. gce_instance { ‘dansinstance’: ensure => present, zone => us-central1-a, machine => n1-standard-1, image => projects/google/images/ubuntu-12-04-v20120621, description => “I’m gonna be a database (as soon as I figure out how)!”, tag => ’danstag’,} # puppetconf # puppetize @ puppetlabs
  19. 19. New Pattern for stacks:Network, Firewall, Instance Class app_stack { gce_network { ‘appnet’: ensure => present, range => 10.0.1.0/24’, } gce_firewall { ‘webhttp’: ensure => present, allowed => tcp:80’, network => ‘appnet’, } gce_instance { ‘server1’: ensure => present, network => ‘appnet’ }} # puppetconf # puppetize @ puppetlabs
  20. 20. We don’t really wantcompute resources, we wantapplications that consumethose resources. # puppetconf # puppetize @ puppetlabs
  21. 21. Step 1. Get content from theforge.gce_instance { ‘dansinstance’: ensure => present, … modules => [‘puppetlabs-mysql’, ‘saz-memcached’]} # puppetconf # puppetize @ puppetlabs
  22. 22. forge.puppetlabs.com Over 500 modules!!!! I get all of my content from the forge http://for.some.reason.i.ma.de/this # puppetconf # puppetize @ puppetlabs
  23. 23. Step 2. Classify theinstances using forgecontent gce_instance { ‘mysql-server’: ensure => present, …. modules => [‘martasd-mysql’], classes => {‘mediawiki => { server_name => $gce_external_ip’ }, } # puppetconf # puppetize @ puppetlabs
  24. 24. Why is this awesome http://activerain.com/image_store/uploads/5/1/1/2/5/ar118906407752115.jpg# puppetconf # puppetize @ puppetlabs
  25. 25. Puppet is a propercomposition language • Easy to organize complicated stacks. • Supports higher level interfaces. • Better than copy and paste configuration. # puppetconf # puppetize @ puppetlabs
  26. 26. Resources support noop • Possible to see if your description matches the current stack. # puppetconf # puppetize @ puppetlabs
  27. 27. Writable configurationlanguage • People already know how to compose complex configurations with Puppet # puppetconf # puppetize @ puppetlabs
  28. 28. Thank YouDan Bode | Puppet Labsdan@puppetlabs.com

×