What’s in it for you?
Chef demo
Chef architecture
Why use Chef?
What is Chef?
Configuration Management
Components of Chef
Infrastructure as Code
Flavours of Chef
Why use Chef?
Large companies have a constantly changing
infrastructure that requires to be configured and
maintained time to time
Why use Chef?
Large companies have a constantly changing
infrastructure that requires to be configured and
maintained time to time
Why use Chef?
New nodes may get added
Existing systems may fail
Large companies have a constantly changing
infrastructure that requires to be configured and
maintained time to time
Why use Chef?
New nodes may get added
Existing systems may fail
I can’t do it all by myself..
Large companies have a constantly changing
infrastructure that requires to be configured and
maintained time to time
Why use Chef?
This is where Chef comes in and automates the entire
process
Continuous deployment:
-Software is deployed continuously enabling a company to keep in
pace with the market requirements
Why use Chef?
Chef provides:
Continuous deployment:
-Software is deployed continuously enabling a company to keep in
pace with the market requirements
Increase system robustness:
-Infrastructure automation ensures all bugs are caught and removed
before deploying the software
Why use Chef?
Chef provides:
Continuous deployment:
-Software is deployed continuously enabling a company to keep in
pace with the market requirements
Increase system robustness:
-Infrastructure automation ensures all bugs are caught and removed
before deploying the software
Adapt to the Cloud:
-Chef easily integrates with infrastructure on cloud
Why use Chef?
Chef provides:
What is Chef?
Chef is an open source tool developed by OpsCode
What is Chef?
Chef is an open source tool developed by OpsCode
What is Chef?
It is written in Ruby and Erlang
Chef is an open source tool developed by OpsCode
It is written in Ruby and Erlang
It automates configuration and maintenance of multiple servers
What is Chef?
Configuration Management
Configuration Management
Configuration management is a collection of engineering practices that provides a systematic
way to manage entities for efficient deployment.These entities include
Code Infrastructure people
Configuration Management
Configuration management is a collection of engineering practices that provides a systematic
way to manage entities for efficient deployment.These entities include
Code Infrastructure people
Configuration Management
Code needs to be
updated and stored
Infrastructure needs to
be configured
People need
coordination
Configuration Management
A configuration management tool automates these activities. There are two
types of configuration management
Server Server
Configuration Management
Chef follows pull configuration
Server Server
Infrastructure as code
Infrastructure as code
This isTim. He’s working at a large scale company as a system
administrator
Infrastructure as code
I must set up a server and install 20
software applications over it
Infrastructure as code
I must set up a server and install 20
software applications over it
Server is set up
Infrastructure as code
I must set up a server and install 20
software applications over it
Server is set up
It will take me all night to install all 20
software applications though
Infrastructure as code
Server is set up
This wouldn’t be the case if i had a code for installing all
the software rather than doing it manually
I must set up a server and install 20
software applications over it
It will take me all night to install all 20
software applications though
Infrastructure as code
modified
tested
deployed
I could modify the code to meet the software
installation requirements
Infrastructure as code
modified
tested
deployed
Code could be tested to catch any bugs
Infrastructure as code
modified
tested
deployed
Code can be easily deployed and all
installations would take place automatically
Infrastructure as code
Policies and configurations Code
written as
This makes configuration management simpler and
more efficient
Infrastructure as code is a type of it infrastructure where the operations
team manages the code rather than a manual procedure
Components of Chef
workstation
The code for configuring and managing the infrastructure is
created here
Knife is a command line tool that uploads the cookbook to the server
Components of Chef
SERVER
The server is where the Cookbooks are stored
It provides tools required to drive the node configurations
Server may be hosted local or remote
The server is the middle man between workstation and the nodes
Components of Chef
node
Ohai fetches the current state of the node it’s located in
Chef client is responsible for the communication with the server
Each node can have a different configuration requirement
Nodes are the systems that require the configuration
Components of Chef
Chef architecture
Recipes are created at the workstation
Chef architecture
Template ‘etc/simplilearn’ do
source ‘simplilearn1.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
workstation SERVER
node
node
Recipes are created at the workstation
Chef architecture
workstation SERVER
node
node
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Recipes
Chef architecture
Collection of recipes forms a cookbook
workstation SERVER
node
node
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
The Cookbook is uploaded to the server using the knife
Chef architecture
workstation SERVER
node
nodeKnife
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
The Cookbook is uploaded to the server using the knife
Chef architecture
workstation
Knife
SERVER
node
node
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
$ knife upload simpli-db
Ohai, a component of the node checks the system’s
state and sends it to the chef client
Chef architecture
ohai
workstation
ohai
Knife
SERVER
node
node
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
$ knife upload simpli-db
Chef architecture
$ chef-client
The chef client ensures that the node’s state is
consistent with the cookbook
ohai
workstation
ohai
Knife
SERVER
node
node
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
$ knife upload simpli-db
Chef architecture
If not, the client pulls the cookbook from the server
ohai
workstation
ohai
Knife
SERVER
node
node
$ chef-client
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
$ knife upload simpli-db
Chef architecture
The node then configures itself with respect to the
cookbook to the right state
ohai
workstation
ohai
Knife
SERVER
node
node
$ chef-client
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
$ knife upload simpli-db
Chef architecture
The node then configures itself with respect to the
cookbook to the right state
ohai
workstation
ohai
Knife
SERVER
node
node
$ chef-client
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn2.erb’
owner ‘root’
group ‘root’
mode ‘0655’
end
Template ‘etc/simplilearn’ do
source ‘simplilearn3.erb’
owner ‘root’
group ‘root’
mode ‘0755’
end
Recipes
$ knife upload simpli-db
Flavours of Chef
Chef solo has no remote server.The cookbooks are located at the local site itself
Chef server is provided as a service on the cloud.Thus, there is no need to setup a
server yourselfHosted chef
Flavours of Chef
workstation
server
Node
Chef solo
Chef client/server
This is the traditional chef architecture where a remote server is hosted that
communicates between workstation and node
Flavours of Chef
workstation server
workstation server node
node
private chef
This is the enterprise version of chef where the server is hosted within the
enterprise infrastructure
Chef demo
Chef demo
Workstation – CentOS 7 Server - Cloud Service Node - CentOS 7
Chef demo
Download and install Chefdk
on workstation
Make a cookbook and write
the recipe
Set up the server
Link the workstation and upload
the recipe to the server
Configure the node
Key Takeaways
Why use chef? What is chef?
Infrastructure as codeConfiguration management
Key Takeaways
Components of chef architecture of chef
Chef demoFlavours of chef
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps Tools | Simplilearn

Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps Tools | Simplilearn

  • 2.
    What’s in itfor you? Chef demo Chef architecture Why use Chef? What is Chef? Configuration Management Components of Chef Infrastructure as Code Flavours of Chef
  • 3.
  • 4.
    Large companies havea constantly changing infrastructure that requires to be configured and maintained time to time Why use Chef?
  • 5.
    Large companies havea constantly changing infrastructure that requires to be configured and maintained time to time Why use Chef? New nodes may get added Existing systems may fail
  • 6.
    Large companies havea constantly changing infrastructure that requires to be configured and maintained time to time Why use Chef? New nodes may get added Existing systems may fail I can’t do it all by myself..
  • 7.
    Large companies havea constantly changing infrastructure that requires to be configured and maintained time to time Why use Chef? This is where Chef comes in and automates the entire process
  • 8.
    Continuous deployment: -Software isdeployed continuously enabling a company to keep in pace with the market requirements Why use Chef? Chef provides:
  • 9.
    Continuous deployment: -Software isdeployed continuously enabling a company to keep in pace with the market requirements Increase system robustness: -Infrastructure automation ensures all bugs are caught and removed before deploying the software Why use Chef? Chef provides:
  • 10.
    Continuous deployment: -Software isdeployed continuously enabling a company to keep in pace with the market requirements Increase system robustness: -Infrastructure automation ensures all bugs are caught and removed before deploying the software Adapt to the Cloud: -Chef easily integrates with infrastructure on cloud Why use Chef? Chef provides:
  • 11.
  • 12.
    Chef is anopen source tool developed by OpsCode What is Chef?
  • 13.
    Chef is anopen source tool developed by OpsCode What is Chef? It is written in Ruby and Erlang
  • 14.
    Chef is anopen source tool developed by OpsCode It is written in Ruby and Erlang It automates configuration and maintenance of multiple servers What is Chef?
  • 15.
  • 16.
    Configuration Management Configuration managementis a collection of engineering practices that provides a systematic way to manage entities for efficient deployment.These entities include
  • 17.
    Code Infrastructure people ConfigurationManagement Configuration management is a collection of engineering practices that provides a systematic way to manage entities for efficient deployment.These entities include
  • 18.
    Code Infrastructure people ConfigurationManagement Code needs to be updated and stored Infrastructure needs to be configured People need coordination
  • 19.
    Configuration Management A configurationmanagement tool automates these activities. There are two types of configuration management Server Server
  • 20.
    Configuration Management Chef followspull configuration Server Server
  • 21.
  • 22.
    Infrastructure as code ThisisTim. He’s working at a large scale company as a system administrator
  • 23.
    Infrastructure as code Imust set up a server and install 20 software applications over it
  • 24.
    Infrastructure as code Imust set up a server and install 20 software applications over it Server is set up
  • 25.
    Infrastructure as code Imust set up a server and install 20 software applications over it Server is set up It will take me all night to install all 20 software applications though
  • 26.
    Infrastructure as code Serveris set up This wouldn’t be the case if i had a code for installing all the software rather than doing it manually I must set up a server and install 20 software applications over it It will take me all night to install all 20 software applications though
  • 27.
    Infrastructure as code modified tested deployed Icould modify the code to meet the software installation requirements
  • 28.
  • 29.
    Infrastructure as code modified tested deployed Codecan be easily deployed and all installations would take place automatically
  • 30.
    Infrastructure as code Policiesand configurations Code written as This makes configuration management simpler and more efficient Infrastructure as code is a type of it infrastructure where the operations team manages the code rather than a manual procedure
  • 31.
  • 32.
    workstation The code forconfiguring and managing the infrastructure is created here Knife is a command line tool that uploads the cookbook to the server Components of Chef
  • 33.
    SERVER The server iswhere the Cookbooks are stored It provides tools required to drive the node configurations Server may be hosted local or remote The server is the middle man between workstation and the nodes Components of Chef
  • 34.
    node Ohai fetches thecurrent state of the node it’s located in Chef client is responsible for the communication with the server Each node can have a different configuration requirement Nodes are the systems that require the configuration Components of Chef
  • 35.
  • 36.
    Recipes are createdat the workstation Chef architecture Template ‘etc/simplilearn’ do source ‘simplilearn1.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes workstation SERVER node node
  • 37.
    Recipes are createdat the workstation Chef architecture workstation SERVER node node Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Recipes
  • 38.
    Chef architecture Collection ofrecipes forms a cookbook workstation SERVER node node Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes
  • 39.
    The Cookbook isuploaded to the server using the knife Chef architecture workstation SERVER node nodeKnife Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes
  • 40.
    The Cookbook isuploaded to the server using the knife Chef architecture workstation Knife SERVER node node Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes $ knife upload simpli-db
  • 41.
    Ohai, a componentof the node checks the system’s state and sends it to the chef client Chef architecture ohai workstation ohai Knife SERVER node node Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes $ knife upload simpli-db
  • 42.
    Chef architecture $ chef-client Thechef client ensures that the node’s state is consistent with the cookbook ohai workstation ohai Knife SERVER node node Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes $ knife upload simpli-db
  • 43.
    Chef architecture If not,the client pulls the cookbook from the server ohai workstation ohai Knife SERVER node node $ chef-client Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes $ knife upload simpli-db
  • 44.
    Chef architecture The nodethen configures itself with respect to the cookbook to the right state ohai workstation ohai Knife SERVER node node $ chef-client Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes $ knife upload simpli-db
  • 45.
    Chef architecture The nodethen configures itself with respect to the cookbook to the right state ohai workstation ohai Knife SERVER node node $ chef-client Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Template ‘etc/simplilearn’ do source ‘simplilearn2.erb’ owner ‘root’ group ‘root’ mode ‘0655’ end Template ‘etc/simplilearn’ do source ‘simplilearn3.erb’ owner ‘root’ group ‘root’ mode ‘0755’ end Recipes $ knife upload simpli-db
  • 46.
  • 47.
    Chef solo hasno remote server.The cookbooks are located at the local site itself Chef server is provided as a service on the cloud.Thus, there is no need to setup a server yourselfHosted chef Flavours of Chef workstation server Node Chef solo
  • 48.
    Chef client/server This isthe traditional chef architecture where a remote server is hosted that communicates between workstation and node Flavours of Chef workstation server workstation server node node private chef This is the enterprise version of chef where the server is hosted within the enterprise infrastructure
  • 49.
  • 50.
    Chef demo Workstation –CentOS 7 Server - Cloud Service Node - CentOS 7
  • 51.
    Chef demo Download andinstall Chefdk on workstation Make a cookbook and write the recipe Set up the server Link the workstation and upload the recipe to the server Configure the node
  • 52.
    Key Takeaways Why usechef? What is chef? Infrastructure as codeConfiguration management
  • 53.
    Key Takeaways Components ofchef architecture of chef Chef demoFlavours of chef

Editor's Notes