Introduction to Chef- Infrastructure as a Code

Today I am going to discuss basics about Chef. Chef is basically a tool used for the configuration Management. With the help of Chef, you can get the infrastructure as a code or Network as a programmable infrastructure. Chef has a Client-Server architecture. With the help of Chef we can do infrastructure configuration, Application deployment and configuration management.

In Chef, Nodes are dynamically informed with the configurations in the Server and is called Pull Configuration which means that we don’t need to perform any command on the Chef server to drive the configuration on the nodes, nodes will spontaneously apprise themselves with the configurations existing in the Server. The Chef client pulls configuration updates from the chef server in every 30 minutes.

Fig 1.1- Chef as Infrastructure as a code
The Chef client will only make changes when the node is out of spec, it can react to changes using Chef search. Chef permits to dynamically configure and de-provision network infrastructure on request to retain up with spikes in usage and traffic. It permits new services and qualities to be positioned and apprised more regularly, with slight chance of downtime. With Chef, we can take benefit of all the flexibility and cost savings that cloud offers.

There are two ways to accomplish configurations

Pull Configuration: In this type of Configuration Management, the nodes poll a centralized server periodically for updates. These nodes are dynamically configured, and they are pulling configurations from the centralized server. Pull configuration is used by tools like Chef, Puppet etc.
Push Configuration: In this type of Configuration Management, the centralized Server pushes the configurations to the nodes. Unlike Pull Configuration, there are certain commands that have to be executed in the centralized server in order to configure the nodes. Push Configuration is used by tools like Ansible.