Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Chef, Devops, and You Image from http://dev2ops.org/blog/2010/2/22/what-is-devops.html Bryan W. Berry, 18 November 2011
Who am I? <ul><li>Linux Geek for 7 years </li></ul><ul><li>Python, Ruby coder </li></ul><ul><li>Played with a lot of diffe...
We need a new  way to work <ul><li>Infrastructure needs to be </li></ul><ul><li>Repeatable </li></ul><ul><li>Testable </li...
Devops? <ul><li>Agile Development Practices applied to infrastructure </li></ul><ul><li>New tooling to automate infrastruc...
Infrastructure as Code http://www.flickr.com/photos/wonderlane/2306082998/
Chef is . . . <ul><li>A library for Configuration Management </li></ul><ul><li>A Configuration Management System </li></ul...
How Chef works Chef  Server PROD QA DEV Workstation VM Cookbooks Data Bags Attributes
DEV, QA, PROD Servers Supposed to have the same configuration Is this humanly possible  without Chef? I don’t think so PRO...
Chef client runs on each Server They talk to the Chef Server Chef can also run without a server,  chef-solo
We call each system you configure a  Node
 
Attributes are Searchable $ knife search node ‘jdk_version:1.7’ # returns list of nodes with jdk 1.7 search(:node, ‘java_v...
Nodes have  run_list “ run_list”: { “ recipe[java]”, “ recipe[jboss]”, “ role[internal]” }
Nodes have  Roles Roles describe what a  node should be
Roles are Searchable $ knife search role ‘max_children:50’ search(:role, ‘max_children:50’)
Roles have a run_list What  roles  or  recipes  to  apply in  order
Chef manages  resources   on nodes Resources are specified in  recipes,   recipes are stored in  cookbooks A node’s run_li...
 
Client / Server Chef  Server PROD QA DEV Nodes Nodes report their attributes to the  Chef-server with the  ‘ Node’ object ...
Chef  Server PROD QA DEV Nodes Server applies roles and sends run_list, roles, and  all  cookbooks back to clients run_lis...
Skinny Server, Fat Clients No “builds” are done on the server A Node configures itself based on  its run_list and the  dow...
Back to Recipes!
 
 
Ruby, baby! <ul><li>Chef configuration written in pure ruby </li></ul><ul><li>Devops == Ruby </li></ul><ul><li>If you also...
Cookbooks are packages  for Recipes
Cookbook Components Attributes Recipes Metadata Assets (files/templates)
Sharing is beautiful 200+ high-quality cookbooks on community.opscode.com and growing all the time Easy to customize exist...
Data Bags Data Bags are arbitrary stores of globally available JSON data Think of them as global  variables/data sctructur...
Data Bags have Items Data bag  users/john { &quot;comment&quot;: “postgres Rul3z&quot;, &quot;groups&quot;: [“&quot;sysadm...
Data Bags are Searchable! pg_users = search(:users,  “groups:postgres”) group “postgres” do members pg_users end
Code/data Split Recipes Templates Attributes Data Bags Node Object Role Cookbook run_list Node Object Role Environments Th...
tl;dr  How do I get Started? Do the Quick start using  hosted chef, free for 5 nodes  http://wiki.opscode.com/display/chef...
Possible Corporate Setup PROD-Chef  Server PROD QA DEV DEV-Chef  Server Bar Foo Dev Playground: Devs have full access To c...
Tools <ul><li>Chef web interface – Pretty! </li></ul><ul><li>Ohai – collects information about node </li></ul><ul><li>Knif...
A Very Simple Recipe
This should look familiar
How we can use Chef <ul><li>Sysadmins write cookbooks and maintain chef-server </li></ul><ul><li>Devs can also write cookb...
Questions? Bryan Berry  skype: berrdawg [email_address] Portions of this presentations were taken liberally from Joshua Ti...
Upcoming SlideShare
Loading in …5
×

Chef, Devops, and You

13,486 views

Published on

An introduction and tutorial for Chef, a configuration management tool

Published in: Technology, Self Improvement

Chef, Devops, and You

  1. 1. Chef, Devops, and You Image from http://dev2ops.org/blog/2010/2/22/what-is-devops.html Bryan W. Berry, 18 November 2011
  2. 2. Who am I? <ul><li>Linux Geek for 7 years </li></ul><ul><li>Python, Ruby coder </li></ul><ul><li>Played with a lot of different configuration management tools and techniques </li></ul>
  3. 3. We need a new way to work <ul><li>Infrastructure needs to be </li></ul><ul><li>Repeatable </li></ul><ul><li>Testable </li></ul><ul><li>Scalable </li></ul><ul><li>No Snowflakes! </li></ul>
  4. 4. Devops? <ul><li>Agile Development Practices applied to infrastructure </li></ul><ul><li>New tooling to automate infrastructure </li></ul><ul><li>Testing, testing, testing </li></ul>
  5. 5. Infrastructure as Code http://www.flickr.com/photos/wonderlane/2306082998/
  6. 6. Chef is . . . <ul><li>A library for Configuration Management </li></ul><ul><li>A Configuration Management System </li></ul><ul><li>A Systems Integration Platform </li></ul><ul><li>An API for your entire infrastructure </li></ul><ul><li>Open-source! </li></ul>
  7. 7. How Chef works Chef Server PROD QA DEV Workstation VM Cookbooks Data Bags Attributes
  8. 8. DEV, QA, PROD Servers Supposed to have the same configuration Is this humanly possible without Chef? I don’t think so PROD QA DEV == ==
  9. 9. Chef client runs on each Server They talk to the Chef Server Chef can also run without a server, chef-solo
  10. 10. We call each system you configure a Node
  11. 12. Attributes are Searchable $ knife search node ‘jdk_version:1.7’ # returns list of nodes with jdk 1.7 search(:node, ‘java_version:1.7’)
  12. 13. Nodes have run_list “ run_list”: { “ recipe[java]”, “ recipe[jboss]”, “ role[internal]” }
  13. 14. Nodes have Roles Roles describe what a node should be
  14. 15. Roles are Searchable $ knife search role ‘max_children:50’ search(:role, ‘max_children:50’)
  15. 16. Roles have a run_list What roles or recipes to apply in order
  16. 17. Chef manages resources on nodes Resources are specified in recipes, recipes are stored in cookbooks A node’s run_list specifies which recipes (and thus resources) are applied
  17. 19. Client / Server Chef Server PROD QA DEV Nodes Nodes report their attributes to the Chef-server with the ‘ Node’ object attributes Chef Repository
  18. 20. Chef Server PROD QA DEV Nodes Server applies roles and sends run_list, roles, and all cookbooks back to clients run_list, roles, cookbooks Chef Repository
  19. 21. Skinny Server, Fat Clients No “builds” are done on the server A Node configures itself based on its run_list and the downloaded cookbooks
  20. 22. Back to Recipes!
  21. 25. Ruby, baby! <ul><li>Chef configuration written in pure ruby </li></ul><ul><li>Devops == Ruby </li></ul><ul><li>If you also learn Ruby, it will be helpful but is not required </li></ul><ul><li>If you are really curious why devops == Ruby, you read more here http://devopsanywhere.blogspot.com/2011/09/how-ruby-is-beating-python-in-battle.html </li></ul>
  22. 26. Cookbooks are packages for Recipes
  23. 27. Cookbook Components Attributes Recipes Metadata Assets (files/templates)
  24. 28. Sharing is beautiful 200+ high-quality cookbooks on community.opscode.com and growing all the time Easy to customize existing cookbooks Chef’s real value is this collection of cookbooks
  25. 29. Data Bags Data Bags are arbitrary stores of globally available JSON data Think of them as global variables/data sctructures for your infrastructure
  26. 30. Data Bags have Items Data bag users/john { &quot;comment&quot;: “postgres Rul3z&quot;, &quot;groups&quot;: [“&quot;sysadmins&quot;, &quot;postgres&quot; ], &quot;ssh_keys&quot;: &quot;ssh-rsa …..&quot;, &quot;id&quot;: “john&quot;, &quot;shell&quot;: &quot;/bin/bash&quot; }
  27. 31. Data Bags are Searchable! pg_users = search(:users, “groups:postgres”) group “postgres” do members pg_users end
  28. 32. Code/data Split Recipes Templates Attributes Data Bags Node Object Role Cookbook run_list Node Object Role Environments The fact that attributes are in cookbooks, roles, environments, And the node itself can be confusing
  29. 33. tl;dr How do I get Started? Do the Quick start using hosted chef, free for 5 nodes http://wiki.opscode.com/display/chef/Quick+Start You can use Ubuntu, Mac OS X, and maybe Windows
  30. 34. Possible Corporate Setup PROD-Chef Server PROD QA DEV DEV-Chef Server Bar Foo Dev Playground: Devs have full access To chef-server Disposable nodes for testing cookbooks Only sysadmins Have chef access
  31. 35. Tools <ul><li>Chef web interface – Pretty! </li></ul><ul><li>Ohai – collects information about node </li></ul><ul><li>Knife – command-line tool </li></ul><ul><li>Shef – interpreter for working with cookbooks </li></ul><ul><li>git - not part of chef, but hard to use chef without also using git </li></ul>
  32. 36. A Very Simple Recipe
  33. 37. This should look familiar
  34. 38. How we can use Chef <ul><li>Sysadmins write cookbooks and maintain chef-server </li></ul><ul><li>Devs can also write cookbooks to help the sysadmin </li></ul><ul><li>Store of configuration information </li></ul><ul><li>Sysadmins will spend more time </li></ul><ul><li>managing configurations and less time </li></ul><ul><li>managing individual servers </li></ul>
  35. 39. Questions? Bryan Berry skype: berrdawg [email_address] Portions of this presentations were taken liberally from Joshua Timberman’s Chef 101 presentation Copyright Bryan W. Berry 2011 Creative Commons 3.0 Unported CC-BY-SA

×