Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Puppet 101 with Google Compute Engine (Beginner)

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Puppet 101 with Google Compute Engine (Beginner)

This is the slides for the session "Puppet 101 with Google Compute Engine (Beginner)" during 2015 Puppet Camp NYC.

Session:
https://puppetlabs.com/events/puppet-camp-new-york-2015

For more information:
Try Google Cloud Platform for free - http://cloud.google.com
Puppet on Google Compute Engine Blog - http://googlecloudplatform.blogspot.com/2014/04/using-puppet-to-automate-google-compute-engine.html
Awesome code example and self-guided lab - https://github.com/GoogleCloudPlatform/compute-video-demo-puppet

Avatar for Ray Tsang

Ray Tsang

May 15, 2015

More Decks by Ray Tsang

Other Decks in Technology

Transcript

  1. @saturnism #puppetcamp One machine? 1. Manually install OS 2. Configure

    user 3. Configure network 4. Install packages 5. Update configuration 6. Update files 7. Start service
  2. @saturnism #puppetcamp One machine? 1. Debian or Fedora? 2. Configure

    user 3. Configure network 4. Install packages 5. Update configuration 6. Update files 7. Start service
  3. @saturnism #puppetcamp One machine? 1. Debian or Fedora? 2. adduser

    or useradd 3. Configure network 4. Install packages 5. Update configuration 6. Update files 7. Start service
  4. @saturnism #puppetcamp One machine? 1. Debian or Fedora? 2. adduser

    or useradd 3. /etc/network/interfaces or /etc/sysconfig/network-scripts 4. Install packages 5. Update configuration 6. Update files 7. Start service
  5. @saturnism #puppetcamp One machine? 1. Debian or Fedora? 2. adduser

    or useradd 3. /etc/network/interfaces or /etc/sysconfig/network-scripts 4. apt-get or yum? 5. Update configuration 6. Update files 7. Start service
  6. @saturnism #puppetcamp One machine? 1. Debian or Fedora? 2. adduser

    or useradd 3. /etc/network/interfaces or /etc/sysconfig/network-scripts 4. apt-get or yum? 5. Where is that .conf file? 6. Update files 7. Start service
  7. @saturnism #puppetcamp One machine? 1. Debian or Fedora? 2. adduser

    or useradd 3. /etc/network/interfaces or /etc/sysconfig/network-scripts 4. apt-get or yum? 5. Where is that .conf file? 6. vi or emacs? ;) 7. Start service
  8. @saturnism #puppetcamp One machine? 1. Debian or Fedora? 2. adduser

    or useradd 3. /etc/network/interfaces or /etc/sysconfig/network-scripts 4. apt-get or yum? 5. Where is that .conf file? 6. vi or emacs? ;) 7. ...
  9. @saturnism #puppetcamp user { 'ray': name => 'Ray', ensure =>

    'present', groups => [ 'admins' , 'developers' ], password => '[shadowed]', shell => '/bin/bash', } Add User?
  10. @saturnism #puppetcamp class { 'network': interfaces_hash => { 'eth0' =>

    { enable_dhcp => true, }, 'eth1' => { ipaddress => '192.168.0.1, netmask => '255.255.255.0', }, }, } Network Interface?
  11. @saturnism #puppetcamp package { "screen": ensure => "installed" } class

    apache ($version = "latest") { package {"apache2": ensure => $version, } } include apache Installing a Package?
  12. @saturnism #puppetcamp For the past 15 years, Google has been

    building out the world’s fastest, most powerful, highest quality cloud infrastructure on the planet.
  13. @saturnism #puppetcamp Storage Cloud Storage Cloud SQL Cloud Datastore Compute

    Compute Engine App Engine App Services BigQuery Cloud Endpoints Container Engine
  14. @saturnism #puppetcamp Compute Engine Virtual Machines on Google Infrastructure US,

    Europe, and Asia From 1-core to 32-core Up to 208 GB RAM
  15. @saturnism #puppetcamp Storage Persistent Disk (Standard and SSD) - up

    to 10 TB each Local SSD - up to 375 GB x 4 per VM
  16. @saturnism #puppetcamp Project API CLI Code UI Persistent Disk Cloud

    Storage VM VM VM VM VM Load balancing Firewall Private Network Internet
  17. @saturnism #puppetcamp Project API CLI Code UI Persistent Disk Cloud

    Storage VM VM VM VM VM Load balancing Firewall Private Network Internet Puppet!
  18. @saturnism #puppetcamp Target Pool Instance puppet-www-1 Instance puppet-www-3 Instance puppet-www-2

    Instance puppet-www-4 Health Check puppet-http Firewall Rules Load Balancer
  19. @saturnism #puppetcamp Before you start... Create a Google Cloud Platform

    project - $300 Free Trial! http://cloud.google.com/ Install gcloud command line tool https://cloud.google.com/sdk/
  20. @saturnism #puppetcamp Login and set project $ gcloud auth login

    $ gcloud config set project gcp-project-id
  21. @saturnism #puppetcamp Disk puppet-www-boot gce_disk { "puppet-www-boot": ensure => present,

    source_image => 'debian-7', size_gb => '10', zone => "$zone", }
  22. @saturnism #puppetcamp Instance puppet-www Disk puppet-www-boot gce_instance { "puppet-www": ensure

    => present, disk => "puppet-www-boot,boot", requires => Gce_disk["puppet-www-boot"] ... manifest => ‘...’, include apache, }
  23. @saturnism #puppetcamp Instance puppet-www-1 Instance puppet-www-3 Instance puppet-www-2 gce_httphealthcheck {

    'puppet-http': ensure => present, require => Gce_instance['puppet-www-1', ...], description => 'basic http health check', } Instance puppet-www-4 Check Port: 80 URI: / Health Check puppet-http
  24. @saturnism #puppetcamp Target Pool Instance puppet-www-1 Instance puppet-www-3 Instance puppet-www-2

    gce_targetpool { 'puppet-pool': ensure => present, require => Gce_httphealthcheck['puppet-http'], health_checks => 'puppet-http', instances => "$zone/puppet-www-1,..., region => "$region", } Instance puppet-www-4 Health Check puppet-http
  25. @saturnism #puppetcamp Target Pool Instance puppet-www-1 Instance puppet-www-3 Instance puppet-www-2

    gce_firewall { 'puppet-www-http': ensure => present, network => 'default', allowed => 'tcp:80', } Instance puppet-www-4 Firewall Rule Health Check puppet-http
  26. @saturnism #puppetcamp Target Pool Instance puppet-www-1 Instance puppet-www-3 Instance puppet-www-2

    Instance puppet-www-4 Firewall Rules Load Balancer gce_forwardingrule { 'puppet-rule': ensure => present, require => Gce_targetpool[...], port_range => '80', region => "$region", target => 'puppet-pool', } Health Check puppet-http
  27. @saturnism #puppetcamp More Resources! Click to Deploy Puppet Master -

    http://bit.ly/1B0oAkD Using Puppet on GCE - http://bit.ly/1QOchRq Great Hands-on Demo - http://bit.ly/1KQ1m5R