Today, most of the major cloud computing players provide an easy-to-use UI to build your IT infrastructure on the cloud. However, unlike provisioning once on on-premise infrastructure, you may have to dynamically provision (or deprovision) dozens of virtual machine (VM) instances, a few instances of dynamic storage and some SaaS-based services. In addition, software releases need to be pushed regularly (weekly, daily or even hourly in some cases).
One way to go about it is to create VM images for every change and create a new VM instance to push it. However, this is laborious and prone to errors especially if different instances have different application data. Add to that, What about the storage? Databases? Network configuration?
What about architecture? As your usage of cloud infrastructure for Dev/QA/Production environments grow, it becomes an operational challenge to manage the entire infrastructure. Operational tasks listed below becomes a nightmare for a System admin.
• Creating instances
• Configuring instances with storage, services, firewall, software
• Monitoring and deleting instances
• Ensuring all instances in a layer (web/app) are in the same state.
This is when you would need a configuration management system which basically gives you the ability to deploy, update, and repair your entire application infrastructure using nothing but pre-defined, automated procedures. Ideally, you want to automatically provision your entire environment from bare metal all the way up to running business services completely from a pre-defined specification, including the network configuration.
Chef is an infrastructure automation framework that makes it easy to set up, configure, deploy, and manage servers and applications to any environment (physical/virtual/cloud).
With Chef you can code your infrastructure (called ‘recipes’) and use the recipes to set up the infrastructure.
Once automated, you hold a blueprint for your infrastructure, enabling you to build (or rebuild) automatically in minutes or hours – not weeks or months. Better still, in case of disasters (network, hardware or geographical) Chef makes disaster recovery job easier.
Chef has become one of the widely used tools for configuration management. Apart from Chef, tools supporting cloud environments are Puppet, Ansible, Salt. AWS OpsWorks is an application management service that makes it easy for DevOps to model and manage the entire application from load balancers to databases. Amazon OpsWorks supports Chef.
With Chef you will be able to:
• Manage servers by writing recipes.
• Integrate tightly with applications, databases and more.
• Configure applications that require knowledge about your entire infrastructure
• Create perfect clones of QA environments, pre-production environments, partner preview environments and more.
Before we get started working with Chef, let us run through the terms used frequently.
|recipe||Configuration element within an organization. Recipes are used to install, configure|
software and deploy applications
|cookbook||A fundamental unit of configuration and policy distribution. Each cookbook defines a scenario, such as everything needed to install and configure MySQL.|
|knife||Knife is a command-line tool that provides an interface between a local chef-repo and the Chef server. Knife helps provisioning resources, manage recipes/cookbooks, nodes & more.|
|chef-repo||Chef-repo is located on the workstation and contains cookbooks, recipes, roles. Knife is used to upload data to the chef server from the chef-repo.|
|workstation||A workstation is a computer that is configured to run Knife, to synchronize with the chef-repo, and interact with a single server. The workstation is the location from which most users will do most of their work.|
|node||A node is any physical, virtual, or cloud machine that is configured to be maintained by a chef-client|
|run_list||A run_list is an ordered list of roles and/or recipes that are run in exact order.|
|chef-client||A chef-client is an agent that runs locally on every node.|
Chef comprises three main elements: a server, one (or more) nodes, and at least one workstation.
• The server acts as a hub that is available to every node. All chef-client nodes will be registered with the server. The server holds all the cookbooks, recipes and policies. Clients communicate with the server to get the right configuration elements from the server and apply it to the nodes.
• The workstation is the development machine from which configuration elements like cookbooks, recipes, and policies are defined. Configuration elements are synchronized with the chef-repo and uploaded to the server with knife command.
• Nodes contain chef-client which performs all the infrastructure automation.
There are 3 types of Chef Servers
1. Hosted Chef: Hosted Enterprise Chef is a version of the Chef server that is hosted by Chef. Hosted Enterprise Chef is cloud-based, scalable, and available service with resource-based access control. Makes life easier, you will not have to run an additional server and manage it.
2. Enterprise Chef: is similar to hosted chef but the chef server will be located on premise.
3. Open Source Chef is a free version of Chef Server.
We’ve recently written a blog post on getting started with Chef.
Top 20 Open Source Tools for DevOps Success
Open source tools perform a very specific task, and the source code is openly published for use or modification free of charge. I've written about DevOps multiple times on this blog. I reiterate the point that DevOps is not about specific tools. It's a philosophy for building and improv...
How to Get Started With Chef
When you have dozens or even hundreds of machines to manage, manual just isn’t an option. Software updates, security patches, and changes on this scale require automated tools to handle these important tasks in a way that is timely and consistent. Enter automated configuration software ...
Managing Chef Cookbooks the Berkshelf way
Chef cookbooks can become hard to handle; let's talk about Berkshelf management tool Chef is a configuration management tool written in Ruby. With Chef, you can build servers quickly and reliably using cookbooks (which are basically recipes, that can perform tasks like installing webse...
Vagrant and Chef Solo: Bootstrapping an EC2 WordPress Instance
Vagrant with Chef Solo Provisioner for WordPress on AWS's Ec2 In this guide we will learn how to bootstrap an Amazon Ec2 WordPress instance, using a shell script, Vagrant, and Chef Solo. By the way, by making some simple changes to provider configurations, this same Vagrant file can be...
Cloud Technology and Security Alert News Digest – Issue #10
Update 2019: We've been busy working on some great training content around security, check out the Cloud Academy library to prepare on all-things cloud security.Welcome to the Cloud Technology and Security Alert News Digest. This week we've got word of some big platform changes ...
Bootstrapping EC2 Instances with Chef
This is a guest post from 47Line TechnologiesIn the previous blogs, we introduced Chef and set up the Chef Server, Workstation on EC2 instances. Please refer to the earlier blogs here. Configuration Management – Introducing Chef Getting Started with Chef on Amazon AWSIn the bl...
Getting Started with Chef on AWS
This is a guest post from 47Line TechnologiesAs explained in the last blog post, Chef comprises of three main elements - a server, one or more nodes, and at least one workstation.The server acts as a hub that is available to every node. All chef-client nodes will be registered...
Why You Should Learn Cloud Computing
When I started Cloud Academy I had several discussions with many people involved in the IT industry.Some of them are the best system administrators I ever met and some of them have been in the buttons room of big IT infrastructure for years; all of them are now in a difficult positi...