Thursday, October 6, 2016

DevOps - Chef

Chef is a configuration management and automation platform from Opscode. Chef used to automate, test and replicate infrastructure with ease.

Chef available in two format 
  1   Chef – Solo 
     a   Used to install, configure and manage the packages on single environment
  2   Chef - client and server configuration
     a   Chef – Server will be used 
     b   Chef – Client will deployed on linux/windows machine and configured with server

How to Use Chef – Client and server

Setup Chef Server
  1   Download the latest Chef server core
  2   Install the server
  3   Run the chef-server-ctl command to start the Chef server services
  4   Create a User and Organization to link your Chef server with workstations and nodes

Workstations (Client)
Chef workstation is used create and configure any recipes, cookbooks, attributes, and other changes made to Chef Configurations
  1   Download the latest Chef Development Kit for Windows/Linux 
  2   Install ChefDK (based on DK you downloaded)
  3   Generate the chef-repo 
     a   For Linux - mkdir .chef
  4   Navigate/Move to the newly-created directory (/.chef)
  5   Add the RSA Private Keys (You can download same from chef website)
     b   Open the Chef management console.
     c   Click Policy.
     d   Click Clients.
     e   Click Create.
     f   Copy the private key or download and save the private key locally
 6   Generate knife.rb
 7   Create a knife configuration file by navigating to ~/chef-repo/.chef folder and create a file named knife.rb
 8   Add following details into file and save
log_level                :info
log_location             STDOUT
node_name                'username'
client_key               '~/chef-repo/.chef/username.pem'
validation_client_name   'shortname-validator'
validation_key           '~/chef-repo/.chef/shortname.pem'
chef_server_url          ''
syntax_check_cache_path  '~/chef-repo/.chef/syntax_check_cache'
cookbook_path [ '~/chef-repo/cookbooks' ]

Node (Client)
chef-client will be run from node system. 
The chef-client checks the current configuration of the node against the recipes and policies stored in the Chef server and brings the node up to match. 
The process begins with the chef-client checking the node’s run list, loading the cookbooks required, then checking and syncing the cookbooks with the current configuration of the node.

Cookbooks are the main component of configuring nodes on a Chef infrastructure. Cookbooks are comprised of recipes, metadata, attributes, resources, templates, libraries,

Recipes are the fundamental part of cookbooks
Recipes are written in Ruby and contain information in regards to everything that needs to be run, changed, or created on a node

Attributes define specific values about a node and its configuration


DevOps Online Training in Hyderabad said...

Chef is a worth learning as it is a great tool to automate, brings its expertise in DevOps into customer companies. The Information Provided By Your Blog is Useful for me and Other DevOps Candidates. Thanks a lot

Best Regards,
CourseIng - DevOps Training in Hyderabad

Radha Sai said...

Well written.Keep updating Devops Online Course

DevOps Online Training said...

i'm here to learn more about DevOps Thanks for Sharing
Here you can check best DevOps Online Training Institute
DevOps Online Training

viswa teja said...
This comment has been removed by the author.
viswa teja said...

Awesome.. You have clearly is very simple to understand. it's very useful for me to know about new things...Keep posting.Thank You…For more information visit: devops online training