Slide 1

Slide 1 text

@saturnism #puppetcamp Puppet 101 With Google Compute Engine! Ray Tsang Developer Advocate @saturnism

Slide 2

Slide 2 text

@saturnism #puppetcamp Ray Tsang Developer Advocate +RayTsang | @saturnism

Slide 3

Slide 3 text

@saturnism #puppetcamp Ray Tsang Enterprise Architect Systems integration Global consulting firm World-wide hospitality Opensource Middleware

Slide 4

Slide 4 text

@saturnism #puppetcamp How do you provision? Puppet 101 for beginners

Slide 5

Slide 5 text

@saturnism #puppetcamp One machine?

Slide 6

Slide 6 text

@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

Slide 7

Slide 7 text

@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

Slide 8

Slide 8 text

@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

Slide 9

Slide 9 text

@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

Slide 10

Slide 10 text

@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

Slide 11

Slide 11 text

@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

Slide 12

Slide 12 text

@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

Slide 13

Slide 13 text

@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. ...

Slide 14

Slide 14 text

@saturnism #puppetcamp user { 'ray': name => 'Ray', ensure => 'present', groups => [ 'admins' , 'developers' ], password => '[shadowed]', shell => '/bin/bash', } Add User?

Slide 15

Slide 15 text

@saturnism #puppetcamp class { 'network': interfaces_hash => { 'eth0' => { enable_dhcp => true, }, 'eth1' => { ipaddress => '192.168.0.1, netmask => '255.255.255.0', }, }, } Network Interface?

Slide 16

Slide 16 text

@saturnism #puppetcamp package { "screen": ensure => "installed" } class apache ($version = "latest") { package {"apache2": ensure => $version, } } include apache Installing a Package?

Slide 17

Slide 17 text

@saturnism #puppetcamp apache::vhost { 'www.myawesome-site.tld': port => '80', docroot => '/var/www/awesome', serveradmin => '[email protected]' } Configuration?

Slide 18

Slide 18 text

@saturnism #puppetcamp service {"apache2": ensure => running, enable => true, } Start a Service?

Slide 19

Slide 19 text

@saturnism #puppetcamp Put them in a manifest file... Let puppet take care of it $ puppet apply ...

Slide 20

Slide 20 text

@saturnism #puppetcamp One hundred machines? More important than ever!

Slide 21

Slide 21 text

@saturnism #puppetcamp Provisioning a cluster On the Cloud - Google Cloud Platform

Slide 22

Slide 22 text

@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.

Slide 23

Slide 23 text

@saturnism #puppetcamp Storage Cloud Storage Cloud SQL Cloud Datastore Compute Compute Engine App Engine App Services BigQuery Cloud Endpoints Container Engine

Slide 24

Slide 24 text

@saturnism #puppetcamp Compute Engine Virtual Machines on Google Infrastructure US, Europe, and Asia From 1-core to 32-core Up to 208 GB RAM

Slide 25

Slide 25 text

@saturnism #puppetcamp Storage Persistent Disk (Standard and SSD) - up to 10 TB each Local SSD - up to 375 GB x 4 per VM

Slide 26

Slide 26 text

@saturnism #puppetcamp https://twitter.com/gregsramblings/status/576783110899027969

Slide 27

Slide 27 text

@saturnism #puppetcamp

Slide 28

Slide 28 text

@saturnism #puppetcamp Operating Systems Debian, Ubuntu, CoreOS RHEL, SUSE, Windows Server

Slide 29

Slide 29 text

@saturnism #puppetcamp Network Worldwide fiber network Internal vs External Firewall, Load Balancer VPN and Peering options (beta)

Slide 30

Slide 30 text

@saturnism #puppetcamp Live Migration Seamlessly migrate running VM from one physical host to another

Slide 31

Slide 31 text

@saturnism #puppetcamp See http://bit.ly/1cE2s9U for more details

Slide 32

Slide 32 text

@saturnism #puppetcamp Load Balancer HTTP/HTTPS Load Balancer Network Load Balancer Health Checks

Slide 33

Slide 33 text

@saturnism #puppetcamp HTTP/HTTPS Load Balancing Cross Region Content Based

Slide 34

Slide 34 text

@saturnism #puppetcamp Incoming Requests Forwarding Rule (IP Address) X Target Pool Health Check Network Load Balancer

Slide 35

Slide 35 text

@saturnism #puppetcamp Harness the power of Google Compute Engine With Puppet!

Slide 36

Slide 36 text

@saturnism #puppetcamp Puppet DSL for Google Compute Engine https://forge.puppetlabs.com/puppetlabs/gce_compute

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

@saturnism #puppetcamp

Slide 40

Slide 40 text

@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

Slide 41

Slide 41 text

@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/

Slide 42

Slide 42 text

@saturnism #puppetcamp Login and set project $ gcloud auth login $ gcloud config set project gcp-project-id

Slide 43

Slide 43 text

@saturnism #puppetcamp Install module $ puppet module install puppetlabs-gce_compute

Slide 44

Slide 44 text

@saturnism #puppetcamp Update /etc/puppet/device.conf [gcp-project-id] type gce url [/dev/null]:gcp-project-id

Slide 45

Slide 45 text

@saturnism #puppetcamp puppet apply ... --certname=gcp-project-id

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

@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, }

Slide 48

Slide 48 text

@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

Slide 49

Slide 49 text

@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

Slide 50

Slide 50 text

@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

Slide 51

Slide 51 text

@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

Slide 52

Slide 52 text

@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

Slide 53

Slide 53 text

@saturnism #puppetcamp Try Google Compute Engine http://cloud.google.com

Slide 54

Slide 54 text

@saturnism #puppetcamp Thank you! Thank you! Ray Tsang @saturnism Please give us feedback http://bit.ly/1PJtQjj