We are a small, intelligent App development studio. We love "Building Amazing Apps", solving problems and cultivating strong relationships with our clients.
Recent Articles
- Common testing scenarios for Django app.
- Logging in Django
- Serving static files in Django
- Two Scoops of Django: Review
- Introduction to Python Workshop on February 15th, 2013
- Easy client side form validations for Django: Django Parsley
- MoreApps - Android Library Project: Open Sourced
- Tutorial: Building a Chrome app
- Password Generator App: Open Sourced
- Todo List App: Open Sourced
About Agiliq
Topics
Archives
- April 2013
- March 2013
- February 2013
- January 2013
- November 2012
- October 2012
- September 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
- January 2012
- December 2011
- October 2011
- September 2011
- July 2011
- June 2011
- April 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- June 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- April 2009
- March 2009
- February 2009
- November 2008
- October 2008
- June 2008
- May 2008
- April 2008
Provisioning Made Easy With Chef
By : Saket Bhushan
Managing Servers and scaling at will is hard. The bigger web players have put in years of effort, brute-forcing at times and re-iterating their methodologies, have come up with the secret sauce which they use to keep their cloud cool. The article is meant to be introductory rather than comprehensive. Chef has a steep learning curve, and in this post I wish to simplify few of the basic concepts. So, instead of going to the Chef Docs, finding searching, reading and re-reading, few of the beginner concepts are put at one place, which will help you get started on your own.
SysAdmins have started adopting programming paradigms to manage infrastructure. Infrastructure is managed as code. Preparing a server is just running few codes, that's how easy it becomes with a provisioning tool as chef. Chef is a library for configuration management its an API for your entire infrastructure. Using Chef helps you improve scalability and manageability. It helps you save time, money and the pains of doing the same repetitive tasks time and again.
The Chef Architecture:
Chef Server: Central Store of your infrastructure’s configuration data. It stores data necessary to configure your nodes, a REST API makes this data accessible to the nodes. Optionally, it has a WebUI which helps you manage your infrastructure via a web interface.
Nodes: Systems managed by Chef Servers. A node is any host that is configured using chef-client. Chef-client runs on your node which contacts the server for information necessary to configure the node. In simple terms nodes are your servers in the cloud which you want to configure using chef. They can be your webservers, database server etc.
Workstations - The machine where the sysadmin works. Cookbooks are maintained at the workstation. The workstation has two key components:
Few Basic Definitions:
Lets look at few of the basic definitions which we will use later:
Resources are a cross platform abstraction of the things you are configuring on the host.
Parameters are the piece of data that the resources contain.
Action in a resource is what you want to do with the resource.
Providers are the specific implementation of what the resource abstracts. They run the system commands.
Roles provide a way to describe a particular function or type of node. Roles have run_lists and attributes.
Templates are all the files with all the important data substituted with code, so we can fill them later.
Recipes are where you write your resources. The execution is done in top down order.
Mentioned below is how a cookbook folder looks like:
Cookbooks can be found at Github, they are actively maintained by opsCode and the community support. This was a basic intro to Chef, in later posts we will see about the flavors of chef, and which one to use when. This shall act as a building block to the next series of posts. Stay Tuned!
Can we help you build amazing apps? Contact us today.