In this article, I'll make an attempt to elucidate CHEF is a lucid manner. I'll be documenting my learning journey here regarding DevOps and related technologies in coming days. I'm very much open to constructive criticism.
Configuration Management tools are of two types. Push based and Pull based.
Push based: Push configuration server pushes configuration to the nodes. Eg: Ansible, saltstack
Pull based: Push configuration modes check with the server periodically and fetches the configuration from it. Eg: Puppet, Chef
Chef is a company and the name of the configuration management tool written in Ruby and Erlang. It was founded in 2009 by Adam Jacobs. It was initially named as “ Marionette”. Later named to Chef.
On April 2nd 2019, the company announced that all their products are now open source under the Apache 2.0 license.
Chef is being used most of the top companies like Facebook, AWS ops work, HP Public cloud etc.
Chef is an administration tool useful in operations. Whatever system administrators used to do manually, no we are automating all those task by using chef.
Configuration management tool is a method by which we automate admin tasks.
Configuration management tool turns your code into infrastructure so that your code would be repeatable, testable and versionable.
Advantages:
- Complete automation
- Increased uptime
- Improved performance
- Ensures compliance
- Prevents errors
- Reduces costs
Earlier, companies required fifty sysadmins for this task. They are now replaced by 2-3 DevOps engineers considerably reducing the costs of operations.
CHEF ARCHITECTURE OF PROCESS
3 major components that make up the chef architecture:
1.Workstation
2.Chef Server
3.Node
Workstation:
This is where code is written. Workstations are personal computers or virtual servers where all the configuration code is created, tested or changed.
DevOps engineers actually sits here and writes code. This code is called recipe. Collection of recipes is called a cookbook.
Workstation communicates with the chef server using a CLI tool called Knife, that uploads the cookbook to the chef server.
CHEF Server:
This is where the code is uploaded and stored.
It’s the middleman between workstation and nodes. All cookbooks are uploaded and stored here. Server may be hosted locally or remotely.
Nodes:
This is where the code is applied. Nodes are the systems (computer/ server/ machine) that requires the configuration.
Nodes has two parts: Ohai and the chef client.
Ohai fetches the current state of the node it is located in.
Node communicates with the chef server using the chef client.
Each node can have a different configuration required.
Chef client is installed on every node.
Chef client:
It gathers current system configuration.
It downloads the desired system configuration from the chef server.
It configures the node such that it adheres to the policy.
Ohai:
Maintains current state of information of chef node.
Idempotency: Tracking the state of system resources to insure that the changes should not reapply repeatedly.
Chef supermarket: This is where you can get custom code