Chef
Infrastructure as a Code
Agenda
l
Agenda
l
Why chef ?
l
Basics of Chef
l
Demo
l
Question?
Why chef ?
• Manual system administration
• Non-repeatable
• No version control
• Takes too long
Install,
configure
& control
... servers in your sleep
Chef
Chef is
a system and cloud infrastructure
automation framework.
You define recipes of how you
want your system to look and
then chef makes it so.
Chef
• Client-server architecture
• Embraces modern web technologies
• Best ideas from cfengine and Puppet
• Targeted to Linux, Solaris, Window, Mac OS
• Written in Ruby, recipes in Ruby
Chef - IaaC
- Programmatically provision and configure
- Treat like any other code base
- Reconstruct business from code repository,
data backup, and bare metal resources.
Chef - IaaC
Knife
Cookbook
- Fundamental unit of configuration
- Cookbooks contain recipes, templates, files,
custom resources, etc
- Code re-use and modularity
- Hundreds already on
Community.opscode.com
Cookbook
l recipes - list of instructions
l attributes - variables
l definitions - macros of resources
l files - files used by resources
l libraries - Ruby to extend Chef DSL
l metadata.rb
l templates - ERB templates
Node
• Chef-Client generates configuration Directly on
nodes from their run list
• Reduce management complexity through abstraction
• Store the configuration of your programs in version
control
DEMO
Hosted Chef
- Sign up for Opscode Hosted Chef
- https://community.opscode.com/
- Create an Organization
thanks~

Overview of chef ( Infrastructure as a Code )

Editor's Notes

  • #5 Kickstart: a file for installation questions Libvert: The virtualization API, XEN, VMWare, Vitural Box, KVM… Amazon Web Services/Elastic Computer Cloud Fog: Ruby cloud services library
  • #6 Recipes: written in ruby using DSL. A Recipe describes a series of resources that should be in a particular state on a particular part of a server (such as Apache, MySQL, or Hadoop). Resource: A resource is usually a cross platform abstraction of the thing you're configuring on the host. A role sets a list of recipes and attributes to apply to a node A cookbook is a collection of recipes. Knife is the command line interface to the Chef server
  • #13 Chef ensures that actions are not performed if the resources have not changed The Chef Server is built to handle the easy distribution of data to the clients - the recipes to build, templates to render, files to transfer - along with storing the state of each Node. given the same set of Cookbooks, Chef will always execute your resources in the same order.