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

openstack-chef-repo

 openstack-chef-repo

Tomokazu HIRAI

February 12, 2013
Tweet

More Decks by Tomokazu HIRAI

Other Decks in Technology

Transcript

  1. What is Chef ? #1 Chef is an open-source systems

    integration framework built specifically for automating the cloud. * Chef-Server * Node * WorkStation 13೥2݄9೔౔༵೔
  2. What is Chef ? #2 Chef-Server WorkStation Node ʢ̍ʣ ʢ̎ʣ

    ʢ̏ʣ (1) : cookbooks, roles, data_bag, environments ౳ΛΞοϓϩʔυ (2) : node ʹରͯ͠ ‘bootstrap’ ߦ͍σϓϩΠ։࢝ (3) : cookbooks, roles ౳Λμ΢ϯϩʔυ͠ chef-client ࣮ߦ, ͦͷޙ΋ఆظతʹ࣮ߦ openstack-chef-repo 13೥2݄9೔౔༵೔
  3. Why Chef ? * ܁Γฦ࣮͠ߦՄೳ -> ܧଓతσϓϩΠ * ίʔυʹ൚༻ੑΛ࣋ͨͤΔͷ͕༰қ ->

    ࢿ࢈ͷ׆༻ package ‘nginx’ * API -> ΞϓϦ։ൃ͕༰қ 13೥2݄9೔౔༵೔
  4. Chef for OpenStack We are also working with community partners

    such as Rackspace, Dell, DreamHost and HP to help provide a solid basis for deploying and managing OpenStack. http://www.opscode.com/blog/2012/06/27/chef-for- openstack/ ڈ೥6݄ͷ͜ͱ... 13೥2݄9೔౔༵೔
  5. openstack-chef-repo * chef-repo ͱ͸ chef ͷ࡞ۀσΟϨΫτϦ * WorkStation ্ʹ഑ஔ *

    librarian-chef ʹͯ cookbooks (keystone,glance, nova ...) Λऔಘ * environments(ྫ͑͹ production) Ͱ֤ cookbook attribute Λ্ॻ͖͠ શମͷ੔߹ੑΛऔΔ * spiceweasel ʹΑΓ knife ίϚϯυΛग़ྗɾ࣮ߦ 13೥2݄9೔౔༵೔
  6. σΟϨΫτϦߏ੒ openstack-chef-repo ᵓᴷᴷ cookbooks ᴹ ᵓᴷᴷ apache2 ᴹ ᵓᴷᴷ keystone

    ᴹ ᵓᴷᴷ glance ᴹ ᵓᴷᴷ .. ུ ᵓᴷᴷ environments ᴹ ᵋᴷᴷ production.rb ᵓᴷᴷ infrastructure.yml ᵓᴷᴷ roles ᴹ ᵓᴷᴷ allinone.rb ᴹ ᵓᴷᴷ base.rb ᴹ ᵓᴷᴷ glance.rb ᴹ ᵓᴷᴷ horizon-server.rb ᴹ ᵓᴷᴷ .. ུ * ؀ڥʹ߹Θͤͯमਖ਼ɾ௥ه 13೥2݄9೔౔༵೔
  7. ࣮ߦ४උ #1 % gem install librarian chef spiceweasel % git

    clone git://github.com/opscode/openstack-chef-repo.git % cd openstack-chef-repo % librarian-chef update # cookbooks औಘ % vim environments/production.rb ... ུ "osops_networks" => { "public" => "10.200.8.0/24", "management" => "10.200.8.0/24", "nova" => "10.200.8.0/24" }, ... ུ * ௥هमਖ਼ 13೥2݄9೔౔༵೔
  8. ࣮ߦ४උ #2 % vim infrastructure.yml cookbooks: - keystone: #used by

    keystone role version: 2012.1.1 ... ུ roles: - base: - rabbitmq-server: - keystone: ... ུ environments: - production: nodes: - 10.200.8.19: run_list: role[allinone] options: -i ~/.ssh/id_rsa -x root -E production * ௥هमਖ਼ 13೥2݄9೔౔༵೔
  9. ࣮ߦ % spiceweasel infrastructure.yml # ίϚϯυϥΠϯग़ྗ knife cookbook upload apache2

    knife cookbook upload apt ... ུ knife environment from file production.rb knife role from file base.rb knife role from file rabbitmq-server.rb ... ུ knife bootstrap 10.200.8.19 -i ~/.ssh/id_rsa -x root -E production -r 'role[allinone]' % spiceweasel -e infrastructure.yml # ࣮ߦ ... 10෼ఔ౓଴ػ ׬੒! :D 13೥2݄9೔౔༵೔
  10. ·ͱΊ • spiceweasel ͕ΠϯςάϨʔγϣϯͯ͘͠ΕΔ • librarian Ͱ cookbooks Λऔಘ #

    berkshelf ʹஔ͖׵͑ͯ΄͍͠ • environments ʹͯෳ਺؀ڥΛ؅ཧग़དྷΔ (staging, testing ..) • ‘all in one’ ߏ੒΋ෳ਺୆ߏ੒΋Մೳ #ෳ਺୆͸ະ֬ೝ • folsom ϕʔε͸௚ͪʹ։ൃ͕࢝·Δͦ͏, ݱࡏ͸ essex ϕʔε • chef ͸ΠϯετʔϧπʔϧͰ͸ͳ͘ ‘ܧଓతʹσϓϩΠ(ӡ༻)͢ ΔͨΊͷϑϨʔϜϫʔΫ’ Ͱ͋Δ 13೥2݄9೔౔༵೔