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
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?
OR
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.
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

What's hot

Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Software, Inc.
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Software, Inc.
 
Automating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and ChefAutomating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and Chef
kamalikamj
 

What's hot (20)

Consistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and ChefConsistent Development Environment using Vagrant and Chef
Consistent Development Environment using Vagrant and Chef
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
Infrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & AnsibleInfrastructure Automation with Chef & Ansible
Infrastructure Automation with Chef & Ansible
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
SAP TechEd 2013 session Tec118 managing your-environment
SAP TechEd 2013 session Tec118 managing your-environmentSAP TechEd 2013 session Tec118 managing your-environment
SAP TechEd 2013 session Tec118 managing your-environment
 
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
 
Chef in a nutshell
Chef in a nutshellChef in a nutshell
Chef in a nutshell
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Automating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and ChefAutomating Dev Environment - Introduction to Docker and Chef
Automating Dev Environment - Introduction to Docker and Chef
 
Tips and Tricks for Automating Windows with Chef
Tips and Tricks for Automating Windows with ChefTips and Tricks for Automating Windows with Chef
Tips and Tricks for Automating Windows with Chef
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
 
Puppet - an introduction
Puppet - an introductionPuppet - an introduction
Puppet - an introduction
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
AWS Developer Fundamentals
AWS Developer FundamentalsAWS Developer Fundamentals
AWS Developer Fundamentals
 

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

Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
Mohit Sethi
 

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

DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
 
Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
 
Chef vs puppet
Chef vs puppetChef vs puppet
Chef vs puppet
 
Chef
ChefChef
Chef
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
 
Cook Infrastructure with chef -- Justeat.IN
Cook Infrastructure with chef  -- Justeat.INCook Infrastructure with chef  -- Justeat.IN
Cook Infrastructure with chef -- Justeat.IN
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Chef - Administration for programmers
Chef - Administration for programmersChef - Administration for programmers
Chef - Administration for programmers
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
 
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech TalksAnnouncing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
 
Introducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomenessIntroducing Chef | An IT automation for speed and awesomeness
Introducing Chef | An IT automation for speed and awesomeness
 
Using Nagios with Chef
Using Nagios with ChefUsing Nagios with Chef
Using Nagios with Chef
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
 
Introduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef AutomateIntroduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef Automate
 
Building a PaaS using Chef
Building a PaaS using ChefBuilding a PaaS using Chef
Building a PaaS using Chef
 
Mitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorpMitchell Hashimoto, HashiCorp
Mitchell Hashimoto, HashiCorp
 

More from Giedrius Rimkus (7)

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

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 

What is Chef and how we use it at tripsta