SlideShare a Scribd company logo
Chef Fundamentals
training@opscode.com
Copyright (C) 2013 Opscode, Inc.
Introductions
Nathen Harvey
• Technical Community Manager at Opscode
• Co-host of the Food Fight Show Podcast
• @nathenharvey
Webinar Objectives and Style
Multi-week Webinar Series
• After completing of this webinar series you will be
able to
• Automate common infrastructure tasks with Chef
• Describe Chef’s architecture
• Describe Chef’s various tools
• Apply Chef’s primitives to solve your problems
How to learn Chef
• You bring the domain expertise about your business
and problems
• Chef provides a framework for solving those
problems
• Our job is to work together to teach you how to
express solutions to your problems with Chef
Chef is a Language
• Learning Chef is like learning the basics of a
language
• 80% fluency will be reached very quickly
• The remaining 20% just takes practice
• The best way to learn Chef is to use Chef
Questions & Answers
• I’ll post objectives at the beginning of a section
• Ask questions in the chat window when they come to
you
• We’ll answer as many questions as we can at the
end of the session
• The webinar will be recorded and you’ll be able to
watch the recording again.
Agenda
Topics
• Overview of Chef
• Workstation Setup
• Test Node Setup
• Dissecting your first Chef run
• Introducing the Node object
• Writing your first cookbook
Topics
• Setting attributes, cookbook metadata, templates
• Idempotency, notifications, template variables
• Roles
• Using community cookbooks
• Further Resources
Overview of Chef
Lesson Objectives
• After completing the lesson, you will be able to
• Describe how Chef thinks about Infrastructure Automation
• Define the following terms:
• Node
• Resource
• Recipe
• Cookbook
• Run List
• Roles
• Search
Complexity

http://www.flickr.com/photos/michaelheiss/3090102907/
Items of Manipulation (Resources)
• Nodes
• Networking
• Files
• Directories
• Symlinks
• Mounts

• Routes
• Users
• Groups
• Packages
• Services
• Filesystems
A tale of growth...
Application
Add a database
Application

Application Database
Make database redundant
Application

App Databases
Application server redundancy
App Servers

App Databases
Add a load balancer
App LB

App Servers

App Databases
Webscale!
App LBs

App Servers

App Databases
Now we need a caching layer
App LBs
App Servers
App DB Cache
App DBs
Infrastructure has a Topology
App LBs
App Servers
App DB Cache
App DBs
Your Infrastructure is a Snowflake
Round Robin DNS
App Servers
App DB Cache
Floating IP?
App DBs
Complexity Increases Quickly
App LBs
Cache
App Servers
DB Cache

< Shiny!

DB slaves
DBs
Complexity Increases Quickly
App LBs
Cache
App Servers
DB Cache

< Shiny!

A

we
re

nito
mo

g??
rin

DB slaves
DBs
Chef Solves This Problem
™

• But you already
guessed that, didn’t
you?
Managing Complexity
• Organizations
• Environments
• Roles
• Nodes
• Recipes
• Cookbooks
• Search
Organizations
My Infrastructure

Your Infrastructure

Their Infrastructure
Organizations
• Completely independent tenants of Enterprise Chef
• Share nothing with other organizations
• May represent different
• Companies
• Business Units
• Departments
Environments
Development

Staging

Production
Environments
• Model the life-stages of your applications
• Every Organization starts with a single environment
• Environments to reflect your patterns and workflow
• Development
• Test
• Staging
• Production
• etc.
Environments Define Policy
• Environments may include data attributes necessary
for configuring your infrastructure
• The URL of your payment service’s API
• The location of your package repository
• The version of the Chef configuration files that
should be used
Roles
Load Balancers
Application Servers
DB Cache
Database
Roles
• Roles represent the types of servers in your
infrastructure
• Load Balancer
• Application Server
• Database Cache
• Database
• Monitoring
Roles Define Policy
• Roles may include a list of Chef configuration files
that should be applied.
• We call this list a Run List
• Roles may include data attributes necessary for
configuring your infrastructure
• The port that the application server listens on
• A list of applications that should be deployed
Nodes
Nodes
• Nodes represent the servers in your infrastructure
• Nodes may represent physical servers or virtual
servers
• Nodes may represent hardware that you own or may
represent compute instances in a public or private
cloud
Node
• Each Node will
• belong to one Organization
• belong to one Environment
• have zero or more Roles
Nodes Adhere to Policy
• An application, the chef-client, runs on each node
• chef-client will
• gather current system configuration
• download the desired system configuration from
the Chef server
• configure the node such that it adheres to the
policy
Chef is Infrastructure as Code

http://www.flickr.com/photos/louisb/4555295187/

• Programmatically
provision and
configure components
• Treat like any other
code base
• Reconstruct business
from code repository,
data backup, and bare
metal resources.
Configuration Code
• Chef ensures each Node complies with the policy
• Policy is determined by the configurations included
in each Node’s run list
• Reduce management complexity through abstraction
• Store the configuration of your infrastructure in
version control
Delcaritive Interface to Resources
• You define the policy in your Chef configuration
• Your policy states what state each resource should
be in, but not how to get there
• Chef-client will pull the policy from the Chef Server
and enforce the policy on the Node
Resources
• A Resource represents a piece of the system and its
desired state
• A package that should be installed
• A service that should be running
• A file that should be generated
• A cron job that should be configured
• A user that should be managed
• and more
Resources in Recipes
• Resources are the fundamental building blocks of
Chef configuration
• Resources are gathered into Recipes
• Recipes ensure the system is in the desired state
Recipes
• Configuration files that describe resources and their
desired state
• Recipes can:
• Install and configure software components
• Manage files
• Deploy applications
• Execute other recipes
• and more
Recipes
package "apache2"
template "/etc/apache2/apache2.conf" do
source "apache2.conf.erb"
owner "root"
group "root"
mode "0644"
variables(:allow_override => "All")
notifies :reload, "service[apache2]"
end
service "apache2" do
action [:enable,:start]
supports :reload => true
end
Cookbooks
• Recipes are stored in
Cookbooks
• Cookbooks contain recipes,
templates, files, custom
resources, etc
• Code re-use and modularity

http://www.flickr.com/photos/shutterhacks/4474421855/
Run List
Enterprise
Chef

What policy sho
uld

I follow?
chef-client

Node
Run List
Enterprise
Chef

What policy sho
uld

I follow?
chef-client

Node

“recipe[ntp::client]”
“recipe[users]”
“role[webserver]”
Run List
Enterprise
Chef

What policy sho
uld

I follow?
chef-client

“recipe[ntp::client]”
“recipe[users]”
“role[webserver]”
Run Lists Specifies Policy
• The Run List is a collection of policies that the Node
should follow.
• Chef-client obtains the Run List from the Chef
Server
• Chef-client ensures the Node complies with the
policy in the Run List
Search
• Search for nodes with Roles
• Find Topology Data
• IP addresses
• Hostnames
• FQDNs

http://www.flickr.com/photos/kathycsus/2686772625
So when this...
Graphite

Nagios

Jboss App
Memcache
Postgres Slaves
Postgres Master
...becomes this
Graphite

Nagios

Jboss App
Memcache
Postgres Slaves
Postgres Master
...this can happen automatically
Graphite

Nagios

Jboss App
Memcache
Postgres Slaves
Postgres Master
Count the Resources
Graphite

Nagios
Jboss App
Memcache
Postgres Slaves

• 12+ resource changes for 1 node addition

•
•
•
•
•
•
•
•
•
•
•

Load balancer config
Nagios host ping
Nagios host ssh
Nagios host HTTP
Nagios host app health
Graphite CPU
Graphite Memory
Graphite Disk
Graphite SNMP
Memcache firewall
Postgres firewall
Postgres authZ config
Manage Complexity
• Determine the desired state of your infrastructure
• Identify the Resources required to meet that state
• Gather the Resources into Recipes
• Compose a Run List from Recipes and Roles
• Apply a Run List to each Node in your Environment
• Your infrastructure adheres to the policy modeled in
Chef
Configuration Drift
• Configuration Drift happens when:
• Your infrastructure requirements change
• The configuration of a server falls out of policy
• Chef makes it easy to manage
• Model the new requirements in your Chef
configuration files
• Run the chef-client to enforce your policies
Recap
• In today’s webinar, we have
• Described how Chef thinks about Infrastructure Automation
• Defined the following terms:
• Node
• Resource
• Recipe
• Cookbook
• Run List
• Roles
• Search
What Questions Do You Have?
Nathen Harvey
Technical Community Manager, Opscode
nharvey@opscode.com
@nathenharvey

More Related Content

What's hot (20)

PPTX
Docker 101 : Introduction to Docker and Containers
Yajushi Srivastava
 
PPTX
Konsep Routing dalam Laravel (Pemrograman Web II)
I Gede Iwan Sudipa
 
PDF
Flask Basics
Eueung Mulyana
 
PPTX
Docker 101 - Nov 2016
Docker, Inc.
 
PDF
Designing APIs with OpenAPI Spec
Adam Paxton
 
PDF
A Hands-On Introduction To Docker Containers.pdf
Edith Puclla
 
PDF
Docker
SangtongPeesing
 
PPTX
Osgi
Heena Madan
 
PDF
[OPD 2019] Attacking JWT tokens
OWASP
 
PPTX
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
PPTX
Introduction to docker
Frederik Mogensen
 
PDF
Docker Introduction
Peng Xiao
 
PDF
How to connect your OSGi application - Dirk Fauth (Bosch)
mfrancis
 
PDF
Introduction to Github Actions
Knoldus Inc.
 
PPTX
Docker introduction (1)
Gourav Varma
 
PPTX
Docker Swarm for Beginner
Shahzad Masud
 
PPTX
Installing and running Postfix within a docker container from the command line
dotCloud
 
PDF
Jenkins
Roger Xia
 
PPTX
Getting started with Docker
Ravindu Fernando
 
PPTX
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 
Docker 101 : Introduction to Docker and Containers
Yajushi Srivastava
 
Konsep Routing dalam Laravel (Pemrograman Web II)
I Gede Iwan Sudipa
 
Flask Basics
Eueung Mulyana
 
Docker 101 - Nov 2016
Docker, Inc.
 
Designing APIs with OpenAPI Spec
Adam Paxton
 
A Hands-On Introduction To Docker Containers.pdf
Edith Puclla
 
[OPD 2019] Attacking JWT tokens
OWASP
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
Introduction to docker
Frederik Mogensen
 
Docker Introduction
Peng Xiao
 
How to connect your OSGi application - Dirk Fauth (Bosch)
mfrancis
 
Introduction to Github Actions
Knoldus Inc.
 
Docker introduction (1)
Gourav Varma
 
Docker Swarm for Beginner
Shahzad Masud
 
Installing and running Postfix within a docker container from the command line
dotCloud
 
Jenkins
Roger Xia
 
Getting started with Docker
Ravindu Fernando
 
Everything You Need To Know About Persistent Storage in Kubernetes
The {code} Team
 

Similar to Chef Fundamentals Training Series Module 1: Overview of Chef (20)

PDF
Overview of Chef - Fundamentals Webinar Series Part 1
Chef
 
PDF
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
Matt Ray
 
PDF
Introduction to Cooking with Chef
John Osborne
 
PDF
Introduction to Infrastructure as Code & Automation / Introduction to Chef
All Things Open
 
PDF
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Josh Padnick
 
PDF
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Software, Inc.
 
PDF
What is Chef and how we use it at tripsta
Giedrius Rimkus
 
PDF
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Chef
 
PDF
OSDC 2013 | Introduction into Chef by Andy Hawkins
NETWAYS
 
PDF
Introduction to Chef
Pubudu Suharshan Perera
 
PPTX
Introduction to chef
Krishna Kishore
 
PDF
Automating your infrastructure with Chef
John Ewart
 
PDF
Learning chef
Jonathan Carrillo
 
PPTX
Infrastructure modeling with chef
Charles Johnson
 
PPTX
Chef fundamentals
Ygor Nascimento
 
PDF
Node object and roles - Fundamentals Webinar Series Part 3
Chef
 
ODP
DevOps and Chef improve your life
Juan Vicente Herrera Ruiz de Alejo
 
PDF
Chef for openstack
openstackindia
 
PPTX
Chef for Openstack
Mohit Sethi
 
Overview of Chef - Fundamentals Webinar Series Part 1
Chef
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
Matt Ray
 
Introduction to Cooking with Chef
John Osborne
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
All Things Open
 
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Josh Padnick
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Software, Inc.
 
What is Chef and how we use it at tripsta
Giedrius Rimkus
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Chef
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
NETWAYS
 
Introduction to Chef
Pubudu Suharshan Perera
 
Introduction to chef
Krishna Kishore
 
Automating your infrastructure with Chef
John Ewart
 
Learning chef
Jonathan Carrillo
 
Infrastructure modeling with chef
Charles Johnson
 
Chef fundamentals
Ygor Nascimento
 
Node object and roles - Fundamentals Webinar Series Part 3
Chef
 
DevOps and Chef improve your life
Juan Vicente Herrera Ruiz de Alejo
 
Chef for openstack
openstackindia
 
Chef for Openstack
Mohit Sethi
 
Ad

More from Chef Software, Inc. (20)

PDF
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Software, Inc.
 
PDF
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Software, Inc.
 
PDF
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Software, Inc.
 
PPTX
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Chef Software, Inc.
 
PPTX
Opscode Webinar: Cooking with Chef on Microsoft Windows
Chef Software, Inc.
 
PDF
Opscode tech festa july 2013
Chef Software, Inc.
 
PPTX
Opscode Webinar: Automation for Education May 08-2013
Chef Software, Inc.
 
PDF
Utility HPC: Right Systems, Right Scale, Right Science
Chef Software, Inc.
 
PDF
The Berkshelf Way
Chef Software, Inc.
 
PDF
Using Kanban and Chef: A Case Study – Jeffrey Hulten
Chef Software, Inc.
 
PDF
SDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
Chef Software, Inc.
 
PDF
ChefConf 2013 Keynote Session – Opscode – Adam Jacob
Chef Software, Inc.
 
PDF
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...
Chef Software, Inc.
 
PDF
The InstallShield of the 21st Century – Theo Schlossnagle
Chef Software, Inc.
 
PDF
Chef ignited a DevOps revolution – BK Box
Chef Software, Inc.
 
PDF
The unintended benefits of Chef
Chef Software, Inc.
 
PDF
Push jobs: an orchestration building block for private Chef
Chef Software, Inc.
 
PDF
Multi-provider Vagrant and Chef: AWS, VMware, and more
Chef Software, Inc.
 
PDF
Welcome to the IT Industrial Revolution! Are you ready?
Chef Software, Inc.
 
PDF
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...
Chef Software, Inc.
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Software, Inc.
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Software, Inc.
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Software, Inc.
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Chef Software, Inc.
 
Opscode Webinar: Cooking with Chef on Microsoft Windows
Chef Software, Inc.
 
Opscode tech festa july 2013
Chef Software, Inc.
 
Opscode Webinar: Automation for Education May 08-2013
Chef Software, Inc.
 
Utility HPC: Right Systems, Right Scale, Right Science
Chef Software, Inc.
 
The Berkshelf Way
Chef Software, Inc.
 
Using Kanban and Chef: A Case Study – Jeffrey Hulten
Chef Software, Inc.
 
SDN, Network Virtualization and the Software Defined Data Center – Brad Hedlund
Chef Software, Inc.
 
ChefConf 2013 Keynote Session – Opscode – Adam Jacob
Chef Software, Inc.
 
Using Chef and AppFirst to Automate Scale-out/Scale-down of Web Applications ...
Chef Software, Inc.
 
The InstallShield of the 21st Century – Theo Schlossnagle
Chef Software, Inc.
 
Chef ignited a DevOps revolution – BK Box
Chef Software, Inc.
 
The unintended benefits of Chef
Chef Software, Inc.
 
Push jobs: an orchestration building block for private Chef
Chef Software, Inc.
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Chef Software, Inc.
 
Welcome to the IT Industrial Revolution! Are you ready?
Chef Software, Inc.
 
Who Says Elephants Can’t Cook? How IBM and Opscode are changing the role of c...
Chef Software, Inc.
 
Ad

Recently uploaded (20)

PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 

Chef Fundamentals Training Series Module 1: Overview of Chef

  • 3. Nathen Harvey • Technical Community Manager at Opscode • Co-host of the Food Fight Show Podcast • @nathenharvey
  • 5. Multi-week Webinar Series • After completing of this webinar series you will be able to • Automate common infrastructure tasks with Chef • Describe Chef’s architecture • Describe Chef’s various tools • Apply Chef’s primitives to solve your problems
  • 6. How to learn Chef • You bring the domain expertise about your business and problems • Chef provides a framework for solving those problems • Our job is to work together to teach you how to express solutions to your problems with Chef
  • 7. Chef is a Language • Learning Chef is like learning the basics of a language • 80% fluency will be reached very quickly • The remaining 20% just takes practice • The best way to learn Chef is to use Chef
  • 8. Questions & Answers • I’ll post objectives at the beginning of a section • Ask questions in the chat window when they come to you • We’ll answer as many questions as we can at the end of the session • The webinar will be recorded and you’ll be able to watch the recording again.
  • 10. Topics • Overview of Chef • Workstation Setup • Test Node Setup • Dissecting your first Chef run • Introducing the Node object • Writing your first cookbook
  • 11. Topics • Setting attributes, cookbook metadata, templates • Idempotency, notifications, template variables • Roles • Using community cookbooks • Further Resources
  • 13. Lesson Objectives • After completing the lesson, you will be able to • Describe how Chef thinks about Infrastructure Automation • Define the following terms: • Node • Resource • Recipe • Cookbook • Run List • Roles • Search
  • 15. Items of Manipulation (Resources) • Nodes • Networking • Files • Directories • Symlinks • Mounts • Routes • Users • Groups • Packages • Services • Filesystems
  • 16. A tale of growth... Application
  • 19. Application server redundancy App Servers App Databases
  • 20. Add a load balancer App LB App Servers App Databases
  • 22. Now we need a caching layer App LBs App Servers App DB Cache App DBs
  • 23. Infrastructure has a Topology App LBs App Servers App DB Cache App DBs
  • 24. Your Infrastructure is a Snowflake Round Robin DNS App Servers App DB Cache Floating IP? App DBs
  • 25. Complexity Increases Quickly App LBs Cache App Servers DB Cache < Shiny! DB slaves DBs
  • 26. Complexity Increases Quickly App LBs Cache App Servers DB Cache < Shiny! A we re nito mo g?? rin DB slaves DBs
  • 27. Chef Solves This Problem ™ • But you already guessed that, didn’t you?
  • 28. Managing Complexity • Organizations • Environments • Roles • Nodes • Recipes • Cookbooks • Search
  • 30. Organizations • Completely independent tenants of Enterprise Chef • Share nothing with other organizations • May represent different • Companies • Business Units • Departments
  • 32. Environments • Model the life-stages of your applications • Every Organization starts with a single environment • Environments to reflect your patterns and workflow • Development • Test • Staging • Production • etc.
  • 33. Environments Define Policy • Environments may include data attributes necessary for configuring your infrastructure • The URL of your payment service’s API • The location of your package repository • The version of the Chef configuration files that should be used
  • 35. Roles • Roles represent the types of servers in your infrastructure • Load Balancer • Application Server • Database Cache • Database • Monitoring
  • 36. Roles Define Policy • Roles may include a list of Chef configuration files that should be applied. • We call this list a Run List • Roles may include data attributes necessary for configuring your infrastructure • The port that the application server listens on • A list of applications that should be deployed
  • 37. Nodes
  • 38. Nodes • Nodes represent the servers in your infrastructure • Nodes may represent physical servers or virtual servers • Nodes may represent hardware that you own or may represent compute instances in a public or private cloud
  • 39. Node • Each Node will • belong to one Organization • belong to one Environment • have zero or more Roles
  • 40. Nodes Adhere to Policy • An application, the chef-client, runs on each node • chef-client will • gather current system configuration • download the desired system configuration from the Chef server • configure the node such that it adheres to the policy
  • 41. Chef is Infrastructure as Code http://www.flickr.com/photos/louisb/4555295187/ • Programmatically provision and configure components • Treat like any other code base • Reconstruct business from code repository, data backup, and bare metal resources.
  • 42. Configuration Code • Chef ensures each Node complies with the policy • Policy is determined by the configurations included in each Node’s run list • Reduce management complexity through abstraction • Store the configuration of your infrastructure in version control
  • 43. Delcaritive Interface to Resources • You define the policy in your Chef configuration • Your policy states what state each resource should be in, but not how to get there • Chef-client will pull the policy from the Chef Server and enforce the policy on the Node
  • 44. Resources • A Resource represents a piece of the system and its desired state • A package that should be installed • A service that should be running • A file that should be generated • A cron job that should be configured • A user that should be managed • and more
  • 45. Resources in Recipes • Resources are the fundamental building blocks of Chef configuration • Resources are gathered into Recipes • Recipes ensure the system is in the desired state
  • 46. Recipes • Configuration files that describe resources and their desired state • Recipes can: • Install and configure software components • Manage files • Deploy applications • Execute other recipes • and more
  • 47. Recipes package "apache2" template "/etc/apache2/apache2.conf" do source "apache2.conf.erb" owner "root" group "root" mode "0644" variables(:allow_override => "All") notifies :reload, "service[apache2]" end service "apache2" do action [:enable,:start] supports :reload => true end
  • 48. Cookbooks • Recipes are stored in Cookbooks • Cookbooks contain recipes, templates, files, custom resources, etc • Code re-use and modularity http://www.flickr.com/photos/shutterhacks/4474421855/
  • 49. Run List Enterprise Chef What policy sho uld I follow? chef-client Node
  • 50. Run List Enterprise Chef What policy sho uld I follow? chef-client Node “recipe[ntp::client]” “recipe[users]” “role[webserver]”
  • 51. Run List Enterprise Chef What policy sho uld I follow? chef-client “recipe[ntp::client]” “recipe[users]” “role[webserver]”
  • 52. Run Lists Specifies Policy • The Run List is a collection of policies that the Node should follow. • Chef-client obtains the Run List from the Chef Server • Chef-client ensures the Node complies with the policy in the Run List
  • 53. Search • Search for nodes with Roles • Find Topology Data • IP addresses • Hostnames • FQDNs http://www.flickr.com/photos/kathycsus/2686772625
  • 54. So when this... Graphite Nagios Jboss App Memcache Postgres Slaves Postgres Master
  • 56. ...this can happen automatically Graphite Nagios Jboss App Memcache Postgres Slaves Postgres Master
  • 57. Count the Resources Graphite Nagios Jboss App Memcache Postgres Slaves • 12+ resource changes for 1 node addition • • • • • • • • • • • Load balancer config Nagios host ping Nagios host ssh Nagios host HTTP Nagios host app health Graphite CPU Graphite Memory Graphite Disk Graphite SNMP Memcache firewall Postgres firewall Postgres authZ config
  • 58. Manage Complexity • Determine the desired state of your infrastructure • Identify the Resources required to meet that state • Gather the Resources into Recipes • Compose a Run List from Recipes and Roles • Apply a Run List to each Node in your Environment • Your infrastructure adheres to the policy modeled in Chef
  • 59. Configuration Drift • Configuration Drift happens when: • Your infrastructure requirements change • The configuration of a server falls out of policy • Chef makes it easy to manage • Model the new requirements in your Chef configuration files • Run the chef-client to enforce your policies
  • 60. Recap • In today’s webinar, we have • Described how Chef thinks about Infrastructure Automation • Defined the following terms: • Node • Resource • Recipe • Cookbook • Run List • Roles • Search
  • 61. What Questions Do You Have? Nathen Harvey Technical Community Manager, Opscode [email protected] @nathenharvey