SlideShare a Scribd company logo
Configuration Management in the Cloud
with Chef
PDX Cloud
James Casey
james@opscode.com
Twitter: jamesc_000
GitHub: jamesc
www.opscode.com
Tuesday, April 30, 13
• Instant infrastructure
• Unlimited capacity
• Autoscaling
• No commitment
• Immediate replacement
Clouds are great !
Tuesday, April 30, 13
APIs are awesome!
• You can provision
compute resources in
seconds
• You can provision
storage resources in
seconds
• You can provision
network resources in
seconds
• That’s cool.
http://www.flickr.com/photos/jdhancock/3634246981/
Tuesday, April 30, 13
The Dark Side
of the Cloud
Tuesday, April 30, 13
• Performance
• Security
• Price
• Reliability
Why not the Cloud?
Tuesday, April 30, 13
See Node
Application Server
Tuesday, April 30, 13
See Nodes
Application Server
Application Database
Tuesday, April 30, 13
See Nodes Grow
Application Server
Application Databases
Tuesday, April 30, 13
Application Servers
Application Databases
See Nodes Grow
Tuesday, April 30, 13
Application Servers
Application Databases
Load Balancer
See Nodes Grow
Tuesday, April 30, 13
See Nodes Grow
Application Servers
Application Databases
Load Balancers
Tuesday, April 30, 13
See Nodes Grow
Application Servers
Application Database Cache
Load Balancers
Application Databases
Tuesday, April 30, 13
Tied together with Config
Application Servers
Application Database Cache
Load Balancers
Application Databases
Tuesday, April 30, 13
Infrastructure is a Snowflake
Application Servers
Application Database Cache
Load Balancers
Floating IP?
Application Databases
Tuesday, April 30, 13
Evolving Complexity
Load Balancers
Application Servers
NoSQL
Database Slaves
ApplicationCache
Database Cache
Database
Tuesday, April 30, 13
Complexity Grows Quickly
DC1
DC3
DC2
Tuesday, April 30, 13
http://www.flickr.com/photos/16339684@N00/2681435235/
And it Continues to Evolve
Tuesday, April 30, 13
http://www.flickr.com/photos/16339684@N00/2681435235/
And it Continues to Evolve
Ok, so I’ve got a problem.
What’s the solution ?
Tuesday, April 30, 13
Golden Images are not the answer
• Gold is heavy
• Hard to transport
• Hard to mold
• Easy to lose
configuration detail
http://www.flickr.com/photos/garysoup/2977173063/
Tuesday, April 30, 13
Configuration Management and
Automated Systems Integration
is the Answer
http://www.flickr.com/photos/philliecasablanca/3354734116/
Tuesday, April 30, 13
• Turn code and hardware into
infrastructure
• From bare metal to services in
production
• Scale applications as needed
• Conform to policy
• Align to business goals
Configuration Management ?
Tuesday, April 30, 13
Chef - Infrastructure as Code
http://www.flickr.com/photos/louisb/4555295187/
• Programmatically
provision and configure
• Treat like any other code
base
• Reconstruct business from
code repository, data
backup, and bare metal
resources.
Tuesday, April 30, 13
• Chef-Client generates
configurations directly
on nodes from their
run list
• Reduce management
complexity through
abstraction
• Store the configuration
of your programs in
version control
http://www.flickr.com/photos/ssoosay/5126146763/
Nodes
Tuesday, April 30, 13
Collections of Resources
• Networking
• Files
• Directories
• Symlinks
• Mounts
• Routes
• Users
• Groups
• Tasks
• Packages
• Software
• Services
• Configurations
• Other Stuff
http://www.flickr.com/photos/stevekeys/3123167585/
Tuesday, April 30, 13
Declarative Interface to Resources
• Define policy
• Say what, not how
• Pull not Push
http://www.flickr.com/photos/bixentro/2591838509/
Tuesday, April 30, 13
Ruby!
extra_packages = case node['platform']
when "ubuntu","debian"
%w{
ruby1.8
ruby1.8-dev
rdoc1.8
ri1.8
libopenssl-ruby
}
end
extra_packages.each do |pkg|
package pkg do
action :install
end
end
Tuesday, April 30, 13
Or this
search(:users, '*:*') do |u|
user u['id'] do
uid u['uid']
shell u['shell']
home "/home/#{u['id']}"
end
directory "#{home_dir}/.ssh" do
owner u['id']
group u['gid']
mode "0700"
end
template "#{home_dir}/.ssh/authorized_keys" do
source "authorized_keys.erb"
owner u['id']
group u['id']
mode "0600"
variables :ssh_keys => u['ssh_keys']
end
end
Tuesday, April 30, 13
Recipes and Cookbooks
• Recipes are collections of
Resources
• Cookbooks contain
recipes, templates, files,
custom resources, etc
• Code re-use and
modularity
• Hundreds already on
Community.opscode.com
http://www.flickr.com/photos/shutterhacks/4474421855/
Tuesday, April 30, 13
http://www.flickr.com/photos/kathycsus/2686772625
• IP addresses
• Hostnames
• FQDNs
• Search for nodes
with Roles
• Find configuration
data
Search
Tuesday, April 30, 13
pool_members = search("node","role:webserver”)
template "/etc/haproxy/haproxy.cfg" do
source "haproxy-app_lb.cfg.erb"
owner "root"
group "root"
mode 0644
variables :pool_members => pool_members.uniq
notifies :restart, "service[haproxy]"
end
Pass Results to Templates
Tuesday, April 30, 13
# Set up application listeners here.
listen application 0.0.0.0:80
balance roundrobin
<% @pool_members.each do |member| -%>
server <%= member[:hostname] %> <%= member[:ipaddress] %>:> weight 1 maxconn 1 check
<% end -%>
<% if node["haproxy"]["enable_admin"] -%>
listen admin 0.0.0.0:22002
mode http
stats uri /
<% end -%>
Pass Results to Templates
Tuesday, April 30, 13
Jboss App
Memcache
Postgres Slaves
Postgres Master
So when this
NagiosGraphite
Tuesday, April 30, 13
Jboss App
Memcache
Postgres Slaves
Postgres Master
NagiosGraphite
Becomes this
Tuesday, April 30, 13
Jboss App
Memcache
Postgres Slaves
Postgres Master
NagiosGraphite
Updates can be automatic
Tuesday, April 30, 13
NagiosGraphite
Count the resources
Jboss App
Memcache
Postgres Slaves
• Load balancer config
• Nagios host ping
• Nagios host ssh
• Nagios host HTTP
• Nagios host app health
• Graphite CPU
• Graphite Memory
• Graphite Disk
• Graphite SNMP
• Memcache firewall
• Postgres firewall
• Postgres authZ config
• 12+ resource changes for 1 node addition
Tuesday, April 30, 13
http://www.flickr.com/photos/evelynishere/2798236471/
CLONING CANNOT COPE WITH THIS
• Chef can.
Tuesday, April 30, 13
Build anything
• Simple internal applications
• Complex external applications
• Workstations
• Hadoop clusters
• IaaS infrastructure
• PaaS infrastructure
• SaaS applications
• Storage systems
• You name it
http://www.flickr.com/photos/hyku/245010680/
Tuesday, April 30, 13
And manage it simply
http://www.flickr.com/photos/helico/404640681/
• Automatically
reconfigure
everything
• Linux,Windows,
Unixes, BSDs
• Load balancers
• Metrics collection
systems
• Monitoring systems
• Cloud migrations
become trivial
Tuesday, April 30, 13
knife
Tuesday, April 30, 13
Upload your infrastructure
knife cookbook upload apt
knife cookbook upload chef-client
knife cookbook upload java
knife cookbook upload jpackage
knife cookbook upload ntp
knife cookbook upload sudo
knife cookbook upload tomcat
knife cookbook upload users
knife cookbook upload sample
knife role from file base-cloud.rb
knife role from file tc.rb
knife role from file sample.rb
knife data bag create users
knife data bag from file users jamesc.json
Tuesday, April 30, 13
Build it somewhere
#EC2
knife ec2 server create -S jamesc -i ~/.ssh/jamesc.pem -x ubuntu -G default -I ami-
a7a97dce -f m1.small -d omnibus -r 'role[base-cloud],role[tc],role[sample]'
#Rackspace
knife rackspace server create --image 110 --flavor 2 -i ~/.ssh/jamesc.pem -d omnibus -r
'role[base-cloud],role[tc],role[sample]'
#CloudStack
knife cs server create -S "small instance" -T "CentOS 5.5(64-bit) no GUI (KVM)" -i
~/.ssh/jamesc.pem -d omnibus -r 'role[base-cloud],role[tc],role[sample]'
#Ubuntu Linux
knife bootstrap test.lab -r 'role[webserver]' -i ~/.ssh/jamesc.pem -x ubuntu --sudo -d
omnibus -r 'role[base-cloud],role[tc],role[sample]'
Tuesday, April 30, 13
knife ec2
$ knife ec2
Available ec2 subcommands: (for details, knife SUB-COMMAND --
help)
** EC2 COMMANDS **
knife ec2 flavor list (options)
knife ec2 instance data (options)
knife ec2 server create (options)
knife ec2 server delete SERVER [SERVER] (options)
knife ec2 server list (options)
$ knife ec2 server create -S keypair -i ~/.ssh/id_rsa -x ubuntu
-I ami-4721882e -f m1.small -r 'role[webserver]'
Tuesday, April 30, 13
knife openstack
$ knife openstack
Available openstack subcommands: (for details, knife SUB-
COMMAND --help)
** OPENSTACK COMMANDS **
knife openstack flavor list (options)
knife openstack image list (options)
knife openstack server create (options)
knife openstack server delete SERVER [SERVER] (options)
knife openstack server list (options)
$ knife openstack server create -S keypair -i ~/.ssh/id_rsa
-x ubuntu -I 1231 -f standard.small -r 'role[webserver]'
Tuesday, April 30, 13
Chef for Infrastructure Portability
• knife ec2
• knife rackspace
• knife hp
• knife google
• knife azure
• knife cloudstack
• knife openstack
• knife vsphere
• ... and many
others
Tuesday, April 30, 13
The Chef Community
• Apache License,Version 2.0
• 850+ Individual contributors
• 150+ Corporate contributors
• HP, Dell, Rackspace,VMware, Joyent,
Calxeda, Heroku, SUSE and many more
• 550+ cookbooks
• http://community.opscode.com
Tuesday, April 30, 13
Summary
• Every infrastructure is a unique snowflake
• You need tools to let you do what you
want
• You need the power to grow your
infrastructure
• You need the ability to change your
cloud provider
• Automated Configuration Management is
the solution
Tuesday, April 30, 13
Questions?
http://www.flickr.com/photos/mrchippy/443960682/
Questions?
Tuesday, April 30, 13
Thanks!
James Casey
james@opscode.com
Twitter: jamesc_000
Github: jamesc
www.opscode.com
Tuesday, April 30, 13

More Related Content

PDF
Machine Learning in Rust with Leaf and Collenchyma
PDF
Drupal 8 - Hosting, Performance and Drush
PPTX
From Gust To Tempest: Scaling Storm
KEY
The story and tech of Read the Docs
PDF
Got Logs? Get Answers with Elasticsearch ELK - PuppetConf 2014
PPTX
Aymeric Weinbach - IoT et Azure - Global Azure Bootcamp 2016 Paris
PDF
Ansible PyWAW
PDF
Elastic search integration with hadoop leveragebigdata
Machine Learning in Rust with Leaf and Collenchyma
Drupal 8 - Hosting, Performance and Drush
From Gust To Tempest: Scaling Storm
The story and tech of Read the Docs
Got Logs? Get Answers with Elasticsearch ELK - PuppetConf 2014
Aymeric Weinbach - IoT et Azure - Global Azure Bootcamp 2016 Paris
Ansible PyWAW
Elastic search integration with hadoop leveragebigdata

Viewers also liked (20)

PDF
RHTE2015_CloudForms_OpenStack
PDF
Cloudforms Workshop
PDF
Openstack Cloud Management and Automation Using Red Hat Cloudforms 4.0
PPTX
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
PPTX
Financial Management with ServiceNow at Franke
PDF
System Center + Cireson vs. ServiceNow
PDF
HGConcept-ITOM-Service Centric Operations
PDF
Openstack - Enterprise cloud management platform
PPT
Sebastien goasguen cloud stack and docker
PDF
Samsung presentation
PPTX
Design Summit - UI Roadmap - Dan Clarizio, Martin Povolny
PPTX
OpenCloudConf: It takes an (Open Source) Village to Build a Cloud
PDF
Satellite 6 - Pupet Introduction
PDF
OpenNMS Reporting - Enhancement
PDF
Apache CXF New Directions in Integration
PDF
DevOps, A path to Enterprises to Adopt [Decoding DevOps Conference - InfoSep...
PDF
OpenStack and CloudForms Do's and Dont's
PPTX
Replication - Nick Carboni - ManageIQ Design Summit 2016
PDF
Intro to-puppet
PDF
The Service-Oriented Enterprise with ServiceNow
RHTE2015_CloudForms_OpenStack
Cloudforms Workshop
Openstack Cloud Management and Automation Using Red Hat Cloudforms 4.0
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Financial Management with ServiceNow at Franke
System Center + Cireson vs. ServiceNow
HGConcept-ITOM-Service Centric Operations
Openstack - Enterprise cloud management platform
Sebastien goasguen cloud stack and docker
Samsung presentation
Design Summit - UI Roadmap - Dan Clarizio, Martin Povolny
OpenCloudConf: It takes an (Open Source) Village to Build a Cloud
Satellite 6 - Pupet Introduction
OpenNMS Reporting - Enhancement
Apache CXF New Directions in Integration
DevOps, A path to Enterprises to Adopt [Decoding DevOps Conference - InfoSep...
OpenStack and CloudForms Do's and Dont's
Replication - Nick Carboni - ManageIQ Design Summit 2016
Intro to-puppet
The Service-Oriented Enterprise with ServiceNow
Ad

Similar to Chef - Configuration Management for the Cloud (20)

PDF
OSDC 2013 | Introduction into Chef by Andy Hawkins
PDF
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
PDF
Achieving Infrastructure Portability with Chef
PDF
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
PDF
Chef for OpenStack - OpenStack Fall 2012 Summit
PDF
Chef for OpenStack- Fall 2012.pdf
PDF
Australian OpenStack User Group August 2012: Chef for OpenStack
PDF
OpenStack Deployments with Chef
PPT
vBACD - Introduction to Opscode Chef - 2/29
PDF
What is Chef and how we use it at tripsta
PDF
Introduction to Infrastructure as Code & Automation / Introduction to Chef
PDF
Introduction to Chef
PDF
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
PDF
Automating your infrastructure with Chef
PPTX
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
PDF
Introduction to Infrastructure as Code & Automation / Introduction to Chef
PDF
Planning Application Resilience - Developer Week 2015
PDF
PDF
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
PDF
Chef Fundamentals Training Series Module 1: Overview of Chef
OSDC 2013 | Introduction into Chef by Andy Hawkins
eSynergy Andy Hawkins - Enabling DevOps through next generation configuration...
Achieving Infrastructure Portability with Chef
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
Chef for OpenStack - OpenStack Fall 2012 Summit
Chef for OpenStack- Fall 2012.pdf
Australian OpenStack User Group August 2012: Chef for OpenStack
OpenStack Deployments with Chef
vBACD - Introduction to Opscode Chef - 2/29
What is Chef and how we use it at tripsta
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Chef
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
Automating your infrastructure with Chef
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Planning Application Resilience - Developer Week 2015
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 1: Overview of Chef
Ad

More from James Casey (9)

PDF
Habitat on AKS - Demo
PPTX
Compliance at Velocity with Chef
PPTX
Chef Analytics Webinar
PDF
Chef Analytics (Chef NYC Meeting - July 2014)
PPTX
Chef Actions: Delightful near real-time activity tracking!
PPT
WLCG Grid Infrastructure Monitoring
PPTX
1005 cern-active mq-v2
KEY
Grid Information systems from an Operations Perspective
KEY
Introduction to Django
Habitat on AKS - Demo
Compliance at Velocity with Chef
Chef Analytics Webinar
Chef Analytics (Chef NYC Meeting - July 2014)
Chef Actions: Delightful near real-time activity tracking!
WLCG Grid Infrastructure Monitoring
1005 cern-active mq-v2
Grid Information systems from an Operations Perspective
Introduction to Django

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
cuic standard and advanced reporting.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Electronic commerce courselecture one. Pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.
Teaching material agriculture food technology
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
cuic standard and advanced reporting.pdf
Empathic Computing: Creating Shared Understanding
NewMind AI Monthly Chronicles - July 2025
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx
Electronic commerce courselecture one. Pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Dropbox Q2 2025 Financial Results & Investor Presentation
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Chef - Configuration Management for the Cloud

  • 1. Configuration Management in the Cloud with Chef PDX Cloud James Casey james@opscode.com Twitter: jamesc_000 GitHub: jamesc www.opscode.com Tuesday, April 30, 13
  • 2. • Instant infrastructure • Unlimited capacity • Autoscaling • No commitment • Immediate replacement Clouds are great ! Tuesday, April 30, 13
  • 3. APIs are awesome! • You can provision compute resources in seconds • You can provision storage resources in seconds • You can provision network resources in seconds • That’s cool. http://www.flickr.com/photos/jdhancock/3634246981/ Tuesday, April 30, 13
  • 4. The Dark Side of the Cloud Tuesday, April 30, 13
  • 5. • Performance • Security • Price • Reliability Why not the Cloud? Tuesday, April 30, 13
  • 7. See Nodes Application Server Application Database Tuesday, April 30, 13
  • 8. See Nodes Grow Application Server Application Databases Tuesday, April 30, 13
  • 9. Application Servers Application Databases See Nodes Grow Tuesday, April 30, 13
  • 10. Application Servers Application Databases Load Balancer See Nodes Grow Tuesday, April 30, 13
  • 11. See Nodes Grow Application Servers Application Databases Load Balancers Tuesday, April 30, 13
  • 12. See Nodes Grow Application Servers Application Database Cache Load Balancers Application Databases Tuesday, April 30, 13
  • 13. Tied together with Config Application Servers Application Database Cache Load Balancers Application Databases Tuesday, April 30, 13
  • 14. Infrastructure is a Snowflake Application Servers Application Database Cache Load Balancers Floating IP? Application Databases Tuesday, April 30, 13
  • 15. Evolving Complexity Load Balancers Application Servers NoSQL Database Slaves ApplicationCache Database Cache Database Tuesday, April 30, 13
  • 18. http://www.flickr.com/photos/16339684@N00/2681435235/ And it Continues to Evolve Ok, so I’ve got a problem. What’s the solution ? Tuesday, April 30, 13
  • 19. Golden Images are not the answer • Gold is heavy • Hard to transport • Hard to mold • Easy to lose configuration detail http://www.flickr.com/photos/garysoup/2977173063/ Tuesday, April 30, 13
  • 20. Configuration Management and Automated Systems Integration is the Answer http://www.flickr.com/photos/philliecasablanca/3354734116/ Tuesday, April 30, 13
  • 21. • Turn code and hardware into infrastructure • From bare metal to services in production • Scale applications as needed • Conform to policy • Align to business goals Configuration Management ? Tuesday, April 30, 13
  • 22. Chef - Infrastructure as Code http://www.flickr.com/photos/louisb/4555295187/ • Programmatically provision and configure • Treat like any other code base • Reconstruct business from code repository, data backup, and bare metal resources. Tuesday, April 30, 13
  • 23. • Chef-Client generates configurations directly on nodes from their run list • Reduce management complexity through abstraction • Store the configuration of your programs in version control http://www.flickr.com/photos/ssoosay/5126146763/ Nodes Tuesday, April 30, 13
  • 24. Collections of Resources • Networking • Files • Directories • Symlinks • Mounts • Routes • Users • Groups • Tasks • Packages • Software • Services • Configurations • Other Stuff http://www.flickr.com/photos/stevekeys/3123167585/ Tuesday, April 30, 13
  • 25. Declarative Interface to Resources • Define policy • Say what, not how • Pull not Push http://www.flickr.com/photos/bixentro/2591838509/ Tuesday, April 30, 13
  • 26. Ruby! extra_packages = case node['platform'] when "ubuntu","debian" %w{ ruby1.8 ruby1.8-dev rdoc1.8 ri1.8 libopenssl-ruby } end extra_packages.each do |pkg| package pkg do action :install end end Tuesday, April 30, 13
  • 27. Or this search(:users, '*:*') do |u| user u['id'] do uid u['uid'] shell u['shell'] home "/home/#{u['id']}" end directory "#{home_dir}/.ssh" do owner u['id'] group u['gid'] mode "0700" end template "#{home_dir}/.ssh/authorized_keys" do source "authorized_keys.erb" owner u['id'] group u['id'] mode "0600" variables :ssh_keys => u['ssh_keys'] end end Tuesday, April 30, 13
  • 28. Recipes and Cookbooks • Recipes are collections of Resources • Cookbooks contain recipes, templates, files, custom resources, etc • Code re-use and modularity • Hundreds already on Community.opscode.com http://www.flickr.com/photos/shutterhacks/4474421855/ Tuesday, April 30, 13
  • 29. http://www.flickr.com/photos/kathycsus/2686772625 • IP addresses • Hostnames • FQDNs • Search for nodes with Roles • Find configuration data Search Tuesday, April 30, 13
  • 30. pool_members = search("node","role:webserver”) template "/etc/haproxy/haproxy.cfg" do source "haproxy-app_lb.cfg.erb" owner "root" group "root" mode 0644 variables :pool_members => pool_members.uniq notifies :restart, "service[haproxy]" end Pass Results to Templates Tuesday, April 30, 13
  • 31. # Set up application listeners here. listen application 0.0.0.0:80 balance roundrobin <% @pool_members.each do |member| -%> server <%= member[:hostname] %> <%= member[:ipaddress] %>:> weight 1 maxconn 1 check <% end -%> <% if node["haproxy"]["enable_admin"] -%> listen admin 0.0.0.0:22002 mode http stats uri / <% end -%> Pass Results to Templates Tuesday, April 30, 13
  • 32. Jboss App Memcache Postgres Slaves Postgres Master So when this NagiosGraphite Tuesday, April 30, 13
  • 33. Jboss App Memcache Postgres Slaves Postgres Master NagiosGraphite Becomes this Tuesday, April 30, 13
  • 34. Jboss App Memcache Postgres Slaves Postgres Master NagiosGraphite Updates can be automatic Tuesday, April 30, 13
  • 35. NagiosGraphite Count the resources Jboss App Memcache Postgres Slaves • Load balancer config • Nagios host ping • Nagios host ssh • Nagios host HTTP • Nagios host app health • Graphite CPU • Graphite Memory • Graphite Disk • Graphite SNMP • Memcache firewall • Postgres firewall • Postgres authZ config • 12+ resource changes for 1 node addition Tuesday, April 30, 13
  • 36. http://www.flickr.com/photos/evelynishere/2798236471/ CLONING CANNOT COPE WITH THIS • Chef can. Tuesday, April 30, 13
  • 37. Build anything • Simple internal applications • Complex external applications • Workstations • Hadoop clusters • IaaS infrastructure • PaaS infrastructure • SaaS applications • Storage systems • You name it http://www.flickr.com/photos/hyku/245010680/ Tuesday, April 30, 13
  • 38. And manage it simply http://www.flickr.com/photos/helico/404640681/ • Automatically reconfigure everything • Linux,Windows, Unixes, BSDs • Load balancers • Metrics collection systems • Monitoring systems • Cloud migrations become trivial Tuesday, April 30, 13
  • 40. Upload your infrastructure knife cookbook upload apt knife cookbook upload chef-client knife cookbook upload java knife cookbook upload jpackage knife cookbook upload ntp knife cookbook upload sudo knife cookbook upload tomcat knife cookbook upload users knife cookbook upload sample knife role from file base-cloud.rb knife role from file tc.rb knife role from file sample.rb knife data bag create users knife data bag from file users jamesc.json Tuesday, April 30, 13
  • 41. Build it somewhere #EC2 knife ec2 server create -S jamesc -i ~/.ssh/jamesc.pem -x ubuntu -G default -I ami- a7a97dce -f m1.small -d omnibus -r 'role[base-cloud],role[tc],role[sample]' #Rackspace knife rackspace server create --image 110 --flavor 2 -i ~/.ssh/jamesc.pem -d omnibus -r 'role[base-cloud],role[tc],role[sample]' #CloudStack knife cs server create -S "small instance" -T "CentOS 5.5(64-bit) no GUI (KVM)" -i ~/.ssh/jamesc.pem -d omnibus -r 'role[base-cloud],role[tc],role[sample]' #Ubuntu Linux knife bootstrap test.lab -r 'role[webserver]' -i ~/.ssh/jamesc.pem -x ubuntu --sudo -d omnibus -r 'role[base-cloud],role[tc],role[sample]' Tuesday, April 30, 13
  • 42. knife ec2 $ knife ec2 Available ec2 subcommands: (for details, knife SUB-COMMAND -- help) ** EC2 COMMANDS ** knife ec2 flavor list (options) knife ec2 instance data (options) knife ec2 server create (options) knife ec2 server delete SERVER [SERVER] (options) knife ec2 server list (options) $ knife ec2 server create -S keypair -i ~/.ssh/id_rsa -x ubuntu -I ami-4721882e -f m1.small -r 'role[webserver]' Tuesday, April 30, 13
  • 43. knife openstack $ knife openstack Available openstack subcommands: (for details, knife SUB- COMMAND --help) ** OPENSTACK COMMANDS ** knife openstack flavor list (options) knife openstack image list (options) knife openstack server create (options) knife openstack server delete SERVER [SERVER] (options) knife openstack server list (options) $ knife openstack server create -S keypair -i ~/.ssh/id_rsa -x ubuntu -I 1231 -f standard.small -r 'role[webserver]' Tuesday, April 30, 13
  • 44. Chef for Infrastructure Portability • knife ec2 • knife rackspace • knife hp • knife google • knife azure • knife cloudstack • knife openstack • knife vsphere • ... and many others Tuesday, April 30, 13
  • 45. The Chef Community • Apache License,Version 2.0 • 850+ Individual contributors • 150+ Corporate contributors • HP, Dell, Rackspace,VMware, Joyent, Calxeda, Heroku, SUSE and many more • 550+ cookbooks • http://community.opscode.com Tuesday, April 30, 13
  • 46. Summary • Every infrastructure is a unique snowflake • You need tools to let you do what you want • You need the power to grow your infrastructure • You need the ability to change your cloud provider • Automated Configuration Management is the solution Tuesday, April 30, 13
  • 48. Thanks! James Casey james@opscode.com Twitter: jamesc_000 Github: jamesc www.opscode.com Tuesday, April 30, 13