• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Shell's Kitchen: Infrastructure As Code (Webexpo 2012)
 

Shell's Kitchen: Infrastructure As Code (Webexpo 2012)

on

  • 4,214 views

Slides for the tutorial by Karel Minarik and Vojtech Hyza at the Webexpo 2012 conference. ...

Slides for the tutorial by Karel Minarik and Vojtech Hyza at the Webexpo 2012 conference.

Please see the GitHub repositories for the code:

* http://git.io/chef-solo-hello-world
* http://git.io/chef-hello-cloud

Statistics

Views

Total Views
4,214
Views on SlideShare
3,083
Embed Views
1,131

Actions

Likes
2
Downloads
35
Comments
2

10 Embeds 1,131

http://webexpo.cz 873
http://webexpo.net 146
https://twitter.com 83
https://si0.twimg.com 11
http://webexpo.innit.cz 5
http://test.webexpo.cz 4
http://localhost 4
https://twimg0-a.akamaihd.net 2
http://en_webexpo 2
http://test.webexpo.net 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

12 of 2 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Shell's Kitchen: Infrastructure As Code (Webexpo 2012) Shell's Kitchen: Infrastructure As Code (Webexpo 2012) Presentation Transcript

    • Shell’s KitchenAno, Chefe!Karel Minařík & Vojtěch Hýža
    • Vojtěch Hýža Karel MinaříkSocial Insider elasticsearch@vhyza @karmiq Shell’s Kitchen
    • 2 separate deployments2 dev|ops> 20 servers in EC2
    • We’re hiring! We’re hiring!Vojtěch Hýža Karel MinaříkSocial Insider elasticsearch.com@vhyza @karmiq Shell’s Kitchen
    • 1 README 15 mins2 “Hello World” 15 mins3 “Hello Cloud” 30 mins Shell’s Kitchen
    • “Enable the reconstruction of the businessfrom nothing but a source code repository,an application data backup, and bare metalresources”— Jesse Robins, Opscode Shell’s Kitchen
    • “SSH and a for loop is not a solution” Luke Kanies, inventor of Puppet 2 9 7 3 .1 - . 18 s u 1 29 udo 4. s 17 er " in erv v e r @$ s y es tart p s er ser -- res r/ a e a f or h $u pdat inx al/v ss m u ng oc
    • Infrastructure As CodeAutomationRepeatabilityAgilityScalabilityDisaster RecoveryStephen Nelson-Smith, Test-Driven Infrastructure with Chef, p. 3-4 Shell’s Kitchen
    • # Install Nginx from package#package "nginx"# Create user and group for Nginx#user node[:nginx][:user] do comment "Nginx User" system true add  . shell "/bin/false"endgroup node[:nginx][:user] do members [ec2-user, node[:nginx][:user]]end# Create service for Nginx (/sbin/service nginx)#service "nginx" do supports :status => true, :restart => true, :reload => true action [ :enable, :start ]end# Create log directory#directory node[:nginx][:log_dir] do mode 0755 owner root recursive trueend# Create Nginx main configuration file#template "nginx.conf" do path "#{node[:nginx][:dir]}/nginx.conf" source "nginx.conf.erb" owner root mode 0644
    • What is Chef?An open-source framework, tool and API forinfrastructure provisioning and management, maintainedand supported by Opscode.You can use it to maintain a single server for yourWordpress blog, or a cluster of machines in productionwith equal ease.You can re-use knowledge and code from the larger#devops community and use the tooling provided bysurrounding ecosystem.
    • Chef Concepts database database-­‐1 Servers Roles Nodes directory "/tmp/something" do owner "root" group "root" mode "0755" action :create {version:  "1"} end Attributes Recipes Templates, Data Bags, Static files, Libraries, ... Cookbooks contains resources & providers Shell’s Kitchen
    • Demo 1: “Hello World” with Chef Solohttp://git.io/chef-solo-hello-world1. Install Nginx2. Add a simple website for Nginx3. Use node attributes in the template4. Launch the node in Amazon EC2 Shell’s Kitchen
    • http://vagrantup.com
    • Chef Server Chef $  chef-­‐client Server database-­‐1 Servers Nodes …" *  " ata Cookbooks Roles e:d Nodes nam Data bags $  knife  status sh   Full Text Search … $  knife  search  node  … e  s $  knife  cookbook  upload  … nif $  k Cookbooks Workstation Shell’s Kitchen
    • Load BalancerApplication 1 Application 1 Application 1 Database elasticsearch A Redis | PostgreSQL elasticsearch B Shell’s Kitchen
    • https://rubygems.org
    • Demo 2: “Hello Cloud” with Chef Serverhttp://git.io/chef-hello-cloud‣ Deploy a Ruby On Rails application on EC2 from a “zero state”‣ 1 load balancer (HAproxy), 3 application servers (Thin+Nginx)‣ 1 database node (PostgreSQL, Redis)‣ 2 elasticsearch nodes‣ Install Ruby 1.9.3 via RVM‣ Clone the application from (forked) GitHub repository‣ init.d scripts and full configuration for every component‣ Restore data from backup (database and search index)‣ Monitor every part of the stack‣ Under 30 minutes Shell’s Kitchen
    • INFRASTRUCTURE AS CODE, DEVOPS, CHEFResourceshttp://wiki.opscode.com/display/chef/Guideshttp://wiki.opscode.com/display/chef/Resourceshttp://wiki.opscode.com/display/chef/Chef+Solohttp://wiki.opscode.com/display/chef/Architecture+Introductionhttp://agilesysadmin.net/ec2-outage-lessonshttp://www.aosabook.org/en/puppet.htmlhttp://devopsanywhere.blogspot.it/2011/10/puppet-vs-chef-fight.htmlhttp://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/http://blog.nistu.de/2012/03/04/reusability-in-configuration-management-systems/http://www.slideshare.net/infochimps/chefconf-2012-13016159/23http://vagrantup.com/v1/docs/provisioners.html
    • Thanks! d