Migration In a Nutshell Migration In a Nutshell Migration In a Nutshell D.S. Macpherson.
Chef in a nutshell
-
Upload
roberto-gaiser -
Category
Technology
-
view
108 -
download
5
description
Transcript of Chef in a nutshell
ChefIn a Nutshell
Chef?
● Thick Clients, Thin Server● Order Matters● Ruby● Chef Solo● OHAI ● Knife
Chef Server Architecture
Chef Components
● Chef Client○ Public/Private key○ Machines/Humans
● Chef Node ● Chef Indexer
○ RabbitMQ○ Chef Expander/SOLR
● Chef Server○ CouchDB○ Web Interface○ REST API
● Chef Solo○ Vagrant - development and tests
Cooking with Chef
● Nodes○ Roles○ Cookbooks○ Recipes ○ Resources
● Environment● Data bags (JSON)
Anatomy of a Chef Run
Anatomy of a Chef Run
● Build, Register, and Authenticate the Node○ OHAI○ chef-validator○ client.pem
● Synchronize Cookbooks○ Libraries○ Attributes○ Definitions○ Recipes
Anatomy of a Chef Run
● Compile Resource Collection○ Load Libraries○ Load Attributes○ Load Definitions○ Load Recipes
● Configure Node○ Converge○ Save Node○ Run Notifications
OHAI
● Gem● Windows● Standalone● Ruby library● Plugins
Chef Basics
● Node○ Run List
■ Recipe■ Role (Ruby/JSON)
○ Attributes○ Tags
● Data Bags○ JSON○ Search○ Encrypte
● Search
Chef Basics● Cookbooks
○ Recipe○ Resources
■ Deploy■ AWS■ Dynect■ Gem, PyPi e PEAR
○ Metadata○ Providers
■ LWRP○ Search○ Exception and Report Handler
Cookbooks
● Version● Library
○ Ruby code● Metadata
○ name○ version○ depends/conflicts/replaces○ supports
● Templates○ ERB
Cookbooks
● Attributes○ override○ normal○ default
● Definitions● File Distribution● Recipes
○ include○ search○ data bags○ tag
Managing Chef
● Knife○ Bootstrap○ Exec
■ SSH ○ Plugin
■ Windows■ knife-windows ■ Windows Remote Management■ PowerShell
■ EC2/Rackspace/Slicehost/Terremark● Shef
○ irb
Workflow● Environments● Freeze● Metadata version
Development1. Bump the version number as appropriate2. Hack3. Upload and test4. Repeat 2 and 3 as necessary
Production1. Upload and freeze your cookbooks2. Modify your environment to prefer the new version you uploaded3. Upload the updated environment4. Deploy
Links
Opscode Platform "The first five nodes are free!"
Opscode Wiki A Brief Chef Tutorial
Example Cookbooks:
http://github.com/opscode/cookbooks
http://github.com/37signals/37s_cookbooks
http://github.com/engineyard/ey-cloud-recipes