SlideShare a Scribd company logo
What is Chef..
..and how we use it at
Who am I?
 Giedrius Rimkus

      Lithuanian
PHP Developer at tripsta
    Ruby enthusiast
    Basketball lover


                           @giedriusr
I'll be talking about..

 
Sentiments
 
Pain
 
Solution
Back in 2009..
Infrastructure

                 Application
What is Chef and how we use it at tripsta
Infrastructure

                 Application
Infrastructure

       Application   Application   Database
Infrastructure

       Application   Application   Application




                      Database
Infrastructure

       Application   Application   Application




       Application    Database     Application
Infrastructure

       Application   Application   Application




       Application    Database     Application




          API           API
          LB            LB
Complexity
Pain
○   Long installation process
○   Hard maintenance
○   Scaling issues
○   Constantly increased load and usage of
    resources (no load balancer)
Solution
CLUSTER
WTH IS CLUSTER?
What is a Cluster?
It's a group of linked computers, working
together closely thus in many respects forming
a single computer.
Cluster categories
High-availability (HA) clusters
High-availability clusters (also known as failover cluster) are implemented
primarily for the purpose of improving the availability of services that the
cluster provides.
 
Load-balancing clusters
Load-balancing is when multiple computers are linked together to share
computational workload or function as a single virtual computer. Logically,
from the user side, they are multiple machines, but function as a single
virtual machine.
 
Compute clusters
Somes times called as a “Grid computing”. Basically used for calculating huge
stats, etc.
HOW TO BUILD IT?
What is Chef and how we use it at tripsta
OR
What is Chef and how we use it at tripsta
What is Chef and how we use it at tripsta
What is Chef and how we use it at tripsta
What is Chef and how we use it at tripsta
What is Chef and how we use it at tripsta
What is Chef? What problem does it solve?

Chef is an open-source systems integration
framework built specifically for automating
the cloud / system configuration.
 
Chef types
Chef Solo
 
Chef client and Chef server
 
Hosted Chef
 
Private Chef
Chef Solo..
..is an open source standalone version of Chef
that runs locally on your node, detached from
a Chef server.
Chef Client and Chef Server
Chef-client connects to a Chef Server to be told what to
do on the node.
Hosted Chef
As with Chef-Server, Chef-client connects to Hosted Chef
to be told what to do on the local node.
Private Chef..
..is for Enterprises who want the power, flexibility,
availability, and performance of Hosted Chef, but require
that information never leave their private networks.
Why it's an issue?
Infrastructure changes all the time.
Different operating systems
Different hardware from different vendors.
What exactly can you do with Chef?
● Install Operating Systems on new servers.
 
● Install application software on servers.
 
● Have new software automatically configure
  itself to match your environment.
 
● Share recipes (and obtain recipes from)
  other people to install and configure
  software.
Some goodies I like about Chef
"Manage your servers by writing code,
not by running commands."
 
Chef is idempotent
 
Built on top of Ruby
 
 
Chef Server Architecture
Architecture visualization
Basic structure of Chef
Environments
Nodes
Cookbooks
Recipes
Files / Templates
Attributes
Data Bags
Search
What is what?
What   is   recipe?
What   is   cookbook?
What   is   resource?
What   is   node?
What   is   chef-client?
What   is   knife?
What   is   data bag?
What   is   template?
Modeling your
infrastructure
Nodes
A node is a host that runs the Chef client. The
primary features of a node, from Chef's point
of view, are its attributes and its run list.
Nodes are the thing that Recipes and Roles are
applied to.
Roles
A role means grouping similar features of
similar nodes.
Run list
A list of recipes that a node will run.
Configuring Nodes
Cookbooks
A cookbook is a collection of recipe, resource
definition, attribute, library, cookbook file
and template files that chef uses to configure
a system. Cookbooks are typically grouped
around configuring a single package or service.
 
The MySQL cookbook, for example, contains
recipes for both client and server.
What is Chef and how we use it at tripsta
Recipes
Recipes are the files where you write your
resources (code).
Another example
chef/cookbooks/git/recipes/default.rb

package "git-core"
# apt-get install git-core
# yum install git-core
# etc..
Another example
directory "/home/new_folder" do
  mode 0755
  owner "someuser"
  group "www"
  action :create
end
Metadata
Cookbooks often rely on other cookbooks for
pre-requisite functionality. In order for the
server to know which cookbooks to ship to a
client, a cookbook that depends on another
one needs to express that dependency
somewhere. That "somewhere" is in cookbook
metadata.
Resources
A resource is usually a cross platform
abstraction of the thing you're configuring on
the host.
 
Chef's resources are mostly just containers for
data, with some basic validation functionality.
Resources
Have a type
Have a name
Have parameters
Take action to put the resource in the
declared state
Type
Name
Parameters
Action
Providers
The provider is the platform-specific
implementation of the thing a resource
abstracts.
 
On Red Hat or CentOS - yum
Debian and Ubuntu - apt package manager will
be used
Search
Search is built by the Chef Server, and allow
you to query arbitrary data about your
infrastructure
Data Bags
Data Bags store nested key–value data on the
chef server. Data Bag data are searchable, and
can also be loaded directly by name in a
recipe. Data Bags are global for your chef-
server installation–you can think of them as
attributes for your whole infrastructure.
Environments
Provides a mechanism for managing different
architectural segmented spaces such as
production, staging, development, and
testing, etc with one Chef setup.
Chef Workflow
Everyday Chef Workflow for developers
Developer makes changes to Chef recipes, roles, etc.
Developer pushes changes to origin Chef repository
Developer uses Knife to push new code to the Chef Server
Developer uses Knife to tell Chef-clients to update themselves
Chef-client on Chef nodes contact the Chef Server
Chef-client pulls latest code from the Chef Server
Chef-client on the node updates the system
Practical example
Update authorized_keys

$ cat cookbooks/bootstrap/files/default/authorized_keys




$ echo 'ssh-rsa dev4-public-key' >> !$
Committing and pushing
 $ git diff




git add .
git commit -m 'adding new public key'
git push
Updating Chef Server
bundle exec knife cookbook upload bootstrap

cap configure:all


or

ssh root@127.0.0.1
$ chef-client
How Chef helped us?
We don't care that much about
Infrastructure changes all the time
 
Scalability, because..
- adding new nodes is painless
- it's fast (takes minutes or hours, not days or weeks)
- there is no need in buying more machines with every
new website
Clear separation between servers
with roles:
 
Frontend
Backend
Application
Memcached
Database
other..
Chef requirements
Chef-client is supported on the following platforms
  ● Ubuntu (10.04, 10.10, 11.04, 11.10)
  ● Debian (5.0, 6.0)
  ● RHEL & CentOS (5.x, 6.x)
  ● Fedora 10+
  ● Mac OS X (10.4, 10.5, 10.6, 10.7)
  ● Windows 7
  ● Windows Server 2003 R2, 2008 R2
 
Ruby
Ruby 1.8.7, 1.9.1 or 1.9.2 with SSL bindings is required.
 
RubyGems
Version 1.3.7 or greater. On Ubuntu and Debian Rubygems should be installed
from source
 
Git?
Parts I didn't cover
-   Setting up and running chef-server / chef-client
-   Shef
-   Knife plugins
-   Chef + capistrano
-   All the rest Chef goodies
Chef Alternatives
●   Puppet
●   Sprinkle
●   Rubber
●   Sunzi
Great resources
https://github.com/opscode/cookbooks
http://wiki.opscode.com/display/chef/Home
http://railscasts.com/episodes/339-chef-solo-basics
https://github.com/ctshryock/capistrano-chef
Thank You
What is Chef and how we use it at tripsta

More Related Content

PDF
PPT
Chef, Devops, and You
PPTX
Chef introduction
ODP
Introduction to Chef
PPTX
Understand Chef
PPTX
Monitoring and tuning your chef server - chef conf talk
PPTX
Opscode Webinar: Managing Your VMware Infrastructure with Chef
PDF
Server Installation and Configuration with Chef
Chef, Devops, and You
Chef introduction
Introduction to Chef
Understand Chef
Monitoring and tuning your chef server - chef conf talk
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Server Installation and Configuration with Chef

What's hot (20)

PDF
Consistent Development Environment using Vagrant and Chef
PPTX
Introduction to chef
PDF
Introduction to Chef
PDF
Chef: Smart infrastructure automation
PPTX
Infrastructure Automation with Chef & Ansible
PDF
Chef Fundamentals Training Series Module 2: Workstation Setup
PPTX
SAP TechEd 2013 session Tec118 managing your-environment
PDF
Automating your infrastructure with Chef
PDF
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
PDF
Infrastructure Automation with Chef
PDF
Chef Fundamentals Training Series Module 1: Overview of Chef
PDF
Ansible Introduction
PPTX
Automating Dev Environment - Introduction to Docker and Chef
PDF
Tips and Tricks for Automating Windows with Chef
PDF
The unintended benefits of Chef
PDF
Compliance as Code
PPTX
Puppet - an introduction
PPTX
Baking docker using chef
PDF
AWS Developer Fundamentals
PDF
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Consistent Development Environment using Vagrant and Chef
Introduction to chef
Introduction to Chef
Chef: Smart infrastructure automation
Infrastructure Automation with Chef & Ansible
Chef Fundamentals Training Series Module 2: Workstation Setup
SAP TechEd 2013 session Tec118 managing your-environment
Automating your infrastructure with Chef
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Infrastructure Automation with Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
Ansible Introduction
Automating Dev Environment - Introduction to Docker and Chef
Tips and Tricks for Automating Windows with Chef
The unintended benefits of Chef
Compliance as Code
Puppet - an introduction
Baking docker using chef
AWS Developer Fundamentals
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Ad

Similar to What is Chef and how we use it at tripsta (20)

PDF
Introduction to Cooking with Chef
PDF
OSDC 2013 | Introduction into Chef by Andy Hawkins
ODP
DevOps and Chef improve your life
PDF
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
PPTX
Chef for Openstack
PDF
Chef for openstack
PDF
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
PDF
Cook like a Chef
PDF
PPTX
Chef fundamentals
PPTX
Chef + AWS + CodeIgniter
PPTX
Chef Jumpstart
PPTX
Introducing Chef | An IT automation for speed and awesomeness
KEY
Using Nagios with Chef
PPTX
Chef onlinuxonpower
PDF
Learning chef
PPTX
Opscode Chef for Dummies
PDF
Chef - Administration for programmers
PDF
Introduction to Chef
Introduction to Cooking with Chef
OSDC 2013 | Introduction into Chef by Andy Hawkins
DevOps and Chef improve your life
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Chef for Openstack
Chef for openstack
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
Cook like a Chef
Chef fundamentals
Chef + AWS + CodeIgniter
Chef Jumpstart
Introducing Chef | An IT automation for speed and awesomeness
Using Nagios with Chef
Chef onlinuxonpower
Learning chef
Opscode Chef for Dummies
Chef - Administration for programmers
Introduction to Chef
Ad

More from Giedrius Rimkus (7)

PDF
Write cross platform native apps in Ruby
PPTX
Moving from Mandrill
PDF
Empowered productivity
PDF
DIRT RALLY
PDF
Single Founder. Everything is possible when you believe at what you do!
PPTX
Shelly cloud & heroku & engineyard. Pros & Cons
PDF
Painless ruby deployment on shelly cloud
Write cross platform native apps in Ruby
Moving from Mandrill
Empowered productivity
DIRT RALLY
Single Founder. Everything is possible when you believe at what you do!
Shelly cloud & heroku & engineyard. Pros & Cons
Painless ruby deployment on shelly cloud

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
KodekX | Application Modernization Development
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Dropbox Q2 2025 Financial Results & Investor Presentation
Per capita expenditure prediction using model stacking based on satellite ima...
Chapter 3 Spatial Domain Image Processing.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
The AUB Centre for AI in Media Proposal.docx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Monthly Chronicles - July 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Unlocking AI with Model Context Protocol (MCP)
Encapsulation_ Review paper, used for researhc scholars
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Weekly Chronicles - August'25 Week I
MYSQL Presentation for SQL database connectivity
Network Security Unit 5.pdf for BCA BBA.
KodekX | Application Modernization Development

What is Chef and how we use it at tripsta