![Page 1: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/1.jpg)
![Page 2: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/2.jpg)
Under The Covers - Chef in 20 Minutes
www.opscode.com
![Page 3: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/3.jpg)
• You have a Cloud
• Now what?
http://www.flickr.com/photos/ian_munroe/4758240536/
Congratulations!!!
![Page 4: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/4.jpg)
APIs are awesome
• You can provision compute resources in seconds
• You can provision storage resources in seconds
• That’s cool.
http://www.flickr.com/photos/jdhancock/3634246981/
Give me some operating system and put it on the network
![Page 5: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/5.jpg)
Chef can help with that
• knife ec2 server create
• knife rackspace server create
• knife terremark server create
• knife gandi server create
• knife bluebox server create
• knife brightbox server create
• knife vsphere server create
• knife openstack server create
• knife eucalyptus server create
http://www.flickr.com/photos/kyz/3122499444/
![Page 6: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/6.jpg)
But then what?
http://www.flickr.com/photos/doctorow/2698336843
![Page 7: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/7.jpg)
You need to configure them
Give me some operating system and put it on the network
![Page 8: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/8.jpg)
Chef can help with that too
• That’s what we do.
![Page 9: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/9.jpg)
Golden Images are not the answer
http://www.flickr.com/photos/bankofengland/5762003476
• Gold is heavy
• Hard to transport
• Hard to mold
• Easy to lose configuration detail
![Page 10: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/10.jpg)
Chef is Infrastructure as Code
http://www.flickr.com/photos/louisb/4555295187/
• Programmatically provision and configure
• Treat like any other code base
• Reconstruct operations from code repository, data backup, and bare metal resources.
![Page 11: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/11.jpg)
Chef configures Resources
http://www.flickr.com/photos/stevekeys/3123167585/
• Nodes
• Networking
• Files
• Directories
• Symlinks
• Mounts
• Routes
• Users and Groups
• Tasks
• Packages
• Software
• Services
• Configurations
• Stuff
![Page 12: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/12.jpg)
With declarative interfaces
• Define policy
• Say what, not how
• Pull not Push
http://www.flickr.com/photos/bixentro/2591838509/
![Page 13: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/13.jpg)
package "ntp" do action :installend
service "ntpd" do action [:enable,:start]end
template "/etc/ntp.conf" do source "ntp.conf.erb" owner "root" group "root" mode 0644 action :create variables( :ntp_server => “time.example.com”) notifies :restart, “service[ntpd]”end
That looks like this
![Page 14: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/14.jpg)
package "net-snmp" do action :installend
service "snmpd" do action [:enable,:start]end
template "/etc/snmpd.conf" do source "snmpd.conf.erb" owner "root" group "root" mode 0644 action :create variables( :community_string => “not_public”) notifies :restart, “service[snmpd]”end
That looks like this
![Page 15: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/15.jpg)
Creating recipes and cookbooks
• Recipes are collections of Resources
• Cookbooks contain recipes, Templates, files, custom resources, etc
• Code re-use and modularity
http://www.flickr.com/photos/shutterhacks/4474421855/
![Page 16: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/16.jpg)
Apply Run Lists to Nodes
ServerServerServerServer
chef-server
API chef-clientOhai!
Give me recipe[ntp::client]
node
ntp
client.rb
executed in order!
![Page 17: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/17.jpg)
ServerServerServerServer
chef-server
API chef-clientOhai!
Give me “ntp::client”,
“openssh::server”
node
ntp
client.rb
openssh
server.rb
Build up reusable code
executed in order!
![Page 18: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/18.jpg)
Apply them in order
ServerServerServerServer
chef-server
API chef-client
Ohai! Give me
“recipe[ntp::client]”, “recipe[openssh::server]”,
“recipe[apache]”,“recipe[php]”node
ntp
client.rb
openssh
server.rb
apache
default.rb
php
default.rb
executed in order!
![Page 19: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/19.jpg)
Roles
Role
RecipeRecipeRecipe
Role
Role
RecipeRecipeRecipeRole
Recipe
ServerServerServerServer
chef-server
API
Knife
![Page 20: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/20.jpg)
ServerServerServerServer
chef-server
API chef-client Ohai! Give me
“role[base]”,“role[webserver]”
node
ntp
client.rb
openssh
server.rb
apache
default.rb
php
default.rb
Roles
![Page 21: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/21.jpg)
ServerServerServerServer
chef-server
APIchef-client
“role[webserver]”
node
ntp
client.rb
openssh
server.rb
apache
default.rb
php
default.rb
Roles
chef-client
“role[database]”node
ntp
client.rb
openssh
server.rb
mysql
server.rb
![Page 22: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/22.jpg)
Recipes can search chef-sever
• IP addresses
• Hostnames
• FQDNs
• Search for nodes with Roles
• Find configuration data
http://www.flickr.com/photos/fotos_medem/3399096196/
![Page 23: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/23.jpg)
App LBs
App Servers
App DB Cache
App DBs
And stitch together Infrastructures
![Page 24: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/24.jpg)
App LBs
App Servers
App DB Cache
App DBs
Floating IP?
Your Infrastructure is a snow flake
![Page 25: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/25.jpg)
And it Evolves
App LBs
App Servers
NoSQL
DB slaves
Cache
DB Cache
DBs
![Page 26: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/26.jpg)
Quickly
DC1
DC3
DC2
![Page 27: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/27.jpg)
Build anything
• Simple internal applications
• Complex internal applications
• Workstations
• Hadoop clusters
• IaaS applications
• PaaS applications
• SaaS applications
• Storage systems
• You name it
http://www.flickr.com/photos/hyku/245010680/
![Page 28: under the covers -- chef in 20 minutes or less](https://reader034.vdocument.in/reader034/viewer/2022051817/54928e83ac7959412e8b4647/html5/thumbnails/28.jpg)
And manage it simply
http://www.flickr.com/photos/helico/404640681/
• Automatically reconfigure everything
• Load balancers
• Metrics collection systems
• Monitoring systems
• Cloud migrations become trivial