Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's New In Chef 11

What's New In Chef 11

Presented at Boulder DevOps meetup on Feb 11, 2013.

Joshua Timberman

February 12, 2013
Tweet

More Decks by Joshua Timberman

Other Decks in Technology

Transcript

  1. What's New Since Chef 0.10? • Windows support • Librarian

    • Spiceweasel • Foodcritic • Cookbooks in separate repositories • Private Chef • Food Fight podcast • knife plugins for openstack, hp, azure, gce • 0.10 renumbered to Chef 10 • full-stack client • why-run • output formatters • Test Kitchen • Solaris support • Chef Community Summit 2 • Berkshelf • ChefConf • Fauxhai • docs.opscode.com • Hangouts for reviews • nyan-cat output formatter Community 2 Monday, February 11, 13
  2. What is NOT in Chef 11 • CouchDB • Ruby-based

    chef-server-api • depsolver, gecode, treetop • Merb • OpenID support in Web UI • Migration tooling (yet) http://trainweb.org/carl/Pullman150/IMG_3380.jpg 3 Monday, February 11, 13
  3. What’s NEW in Chef 11 (server) • erchef • PostgreSQL

    • nginx • Rails (webui) • bookshelf • omnibus-chef server 4 Monday, February 11, 13
  4. What's new in Chef 11 (client) • chef-apply • partial

    search • users with key pairs • partials in templates • knife-essentials 5 Monday, February 11, 13
  5. nginx erchef solr (lucene) bookshelf PostgreSQL filesystem cookbook store filesystem

    search index RabbitMQ chef-expander chef-webui Chef Server 7 Monday, February 11, 13
  6. Erchef • Erlang • Distributed systems • Concurrent, fault tolerant

    • Complete Chef Server API rewrite 9 Monday, February 11, 13
  7. SQL RDBMS • Started with MySQL • Settled on PostgreSQL

    • Use either if you wish • github.com/opscode/sqerl 10 Monday, February 11, 13
  8. CPU Usage on Chef Server • Erchef + Ruby Chef

    • 12 mo old • 3 CPU aggregate 12 Monday, February 11, 13
  9. Database system Load Average CouchDB MySQL Of course, we all

    know load average is not indicative of performance ;) 16 Monday, February 11, 13
  10. Some other Erchef Features... • Nginx reverse proxy, https •

    WebUI is Ruby on Rails • Bookshelf stores cookbooks, like S3 18 Monday, February 11, 13
  11. "Omnibus" Package • full-stack for the Chef server • RPMs,

    DEBs, Build your own? • opscode.com/chef/install • chef-server-ctl • reconfigure • test • start/stop http://apod.nasa.gov/apod/astropix.html 19 Monday, February 11, 13
  12. 3 Commands: install Chef Server... wget https://s3.../chef-server.deb sudo dpkg -i

    chef-server.deb sudo chef-server-ctl reconfigure # optionally... sudo chef-server-ctl test http://www.opscode.com/chef/install 20 Monday, February 11, 13
  13. Reconfigure... runs Chef! % sudo chef-server-ctl reconfigure ... Recipe: chef-server::erchef

    * service[erchef] action restart - restart service service[erchef] Chef Client finished, 268 resources updated chef-server Reconfigured! 21 Monday, February 11, 13
  14. Pedant testing suite Configuring RSpec for Open-Source Tests _______ _______

    _______ _______ _______ ______ _______ | || || || || || | | | | _ || _ || _____|| || _ || _ || ___| | | | || |_| || |_____ | || | | || | | || |___ | |_| || ___||_____ || _|| |_| || |_| || ___| | || | _____| || |_ | || || |___ |_______||___| |_______||_______||_______||______| |_______| _______ _______ ______ _______ __ _ _______ | || || | | _ || | | || | | _ || ___|| _ || |_| || |_| ||_ _| | |_| || |___ | | | || || | | | | ___|| ___|| |_| || || _ | | | | | | |___ | || _ || | | | | | |___| |_______||______| |__| |__||_| |__| |___| "Accuracy Over Tact" 22 Monday, February 11, 13
  15. Test API, run pedant... % sudo chef-server-ctl test ... Finished

    in 57.33 seconds 70 examples, 0 failures 23 Monday, February 11, 13
  16. Filesystem locations • /opt/chef-server • /etc/chef-server • /var/opt/chef-server • /var/log/chef-server

    Package installation Embedded services Logs! Erchef config, certs 24 Monday, February 11, 13
  17. chef-apply • Run a single recipe file • Doesn't modify

    node's run_list • Included w/ Chef • Take a recipe from a file, a string or STDIN • Thanks, Bryan Berry! 25 Monday, February 11, 13
  18. Example % cat recipe.rb package "git" package "emacs" git "git://github.com/jtimberman/.emacs.d.git"

    do action :sync user "jtimberman" end % sudo chef-apply recipe.rb 26 Monday, February 11, 13
  19. partial search partial_search(:node,  'role:web',      :keys  =>  {  'name'

     =>  [  'name'  ],                            'ip'      =>  [  'ipaddress'  ],                            'kernel_version'  =>  [  'kernel',  'version'  ]                        } ).each  do  |result|    puts  result['name']    puts  result['ip']    puts  result['kernel_version'] end • instead of entire node, just the pieces you want • massive reduction in bandwidth and memory 27 Monday, February 11, 13
  20. users with keypairs • Users have key pairs, like clients

    • Knife connects as a user instead of a client • Post a public key when you create a user/client • "knife user" (11.2.0) http://www.flickr.com/photos/albill/sets/72157628046395000/ 28 Monday, February 11, 13
  21. <?xml version='1.0' encoding='UTF-8'?> <server xmlns="urn:jboss:domain:1.2"> <extensions> <% if @infinispan -%>

    <extension module="org.jboss.as.clustering.infinispan"/> <% end -%> <extension module="org.jboss.as.web"/> <% if @webservices -%> <extension module="org.jboss.as.webservices"/> <% end -%> <extension module="org.jboss.as.weld"/> </extensions> <% if @infinispan include_template "infinispan.xml.erb" end -%> <% if @webservices include_template "webservices.xml.erb" end -%> <socket-binding-group name="standard-sockets" > ...... </socket-binding-group> </server> • Thanks to Andrea Campi! partials in templates http://www.flickr.com/photos/modern_fred/2095565021/ 29 Monday, February 11, 13
  22. knife-essentials • Treat local chef-repo and chef-server like a filesystem

    • knife download • knife diff • knife show • knife upload • knife list • knife deps http://photography.nationalgeographic.com/photography/photo-of-the-day/ 30 Monday, February 11, 13
  23. Chef 11 Breaking Changes • http://wiki.opscode.com/ display/chef/Breaking +Changes+in+Chef+11 • chef-shell

    (formerly shef) • no implicit node attributes (no more node['blah'] = 'foo') http://www.flickr.com/photos/modern_fred/2096352938/ 31 Monday, February 11, 13
  24. Chef 11 Breaking Changes • attribute files may access role

    and environment attributes • delayed notifications run after failed converge • encrypted data bag item format change • chef-client lock so safe from simultaneous runs 32 Monday, February 11, 13
  25. Can I get support for Open Source Chef Server? (from

    Opscode) 34 Monday, February 11, 13
  26. Weird Syntax... -module(ranks). -export([fetch_title_and_rank/1]). -include_lib("xmerl/include/xmerl.hrl"). -define(BASE_URL, "http://webservices.amazon.com/onca/xml?" ++ "&ItemId="). fetch_title_and_rank(ISBN)

    -> URL = amazon_url_for(ISBN), { ok, {_Status, _Headers, Body }} = http:request(URL), { Xml, _Rest } = xmerl_scan:string(Body), [ #xmlText{value=Rank} ] = xmerl_xpath:string("//SalesRank/text()", Xml), [ #xmlText{value=Title} ] = xmerl_xpath:string("//Title/text()", Xml), { Title, Rank }. amazon_url_for(ISBN) -> ?BASE_URL ++ ISBN. No :) http://pragdave.pragprog.com/pragdave/2007/04/a_first_erlang_.html 37 Monday, February 11, 13
  27. Migration tools • Coming soon • But, it's an API...

    • knife download, knife upload works for many use cases 39 Monday, February 11, 13