Agile DevOps - architecture, technical practices, and culture

Use Cloud and DevOps to build infrastructure by rapid agile iterative development using collaborative open source tools:
-chef cookbooks, puppet modules or ansible playbooks to build servers.
-Test Kitchen to deploy and test them.
-EC2Dream a graphic user interface that provides a 'single pane of glass' to do agile devops primarily on cloud servers.
-Cloud Formation or Terraform using cfndsl Ruby or Troposphere DSL for easy orchestration.
-Amazon AWS, Azure, Google Compute Engine, Softlayer, Openstack, Local and Hosted servers.

Chef - Automating Infrastructure

Chef is an open source framework for configuration management that is rapidly gainng popularity in Cloud Computing. Chef consists of:
    Chef Server - Contains all the Configurations called     cookbooks.
    Chef Client - Runs on your server and performs the     configuration.

The architecture is that the chef client "pulls" its cookbooks from chef server and runs the cookbook to configure an application. This is good for a large production environment but for testing it is faster to bypass Chef Server and "push" the chef repository directly to your server, run Chef Solo and see the result.

To save you installing and running a Chef Server opscode also run a Hosted Chef Service. Signup and get 5 servers for free and it is cost effective for more.

CHEF COOKBOOK DEVELOPMENT AND TESTING
Fogviz allows you with "one click" to push the chef cookbooks directly to the EC2 server and run chef solo in a separate window so you can quickly test cookbooks as you develop them.

USING CHEF SOLO IN PRODUCTION
Chef Solo maybe enough so you might not need chef server
    1. You can create an image of the server and run that image in production.
    2. Run chef solo at startup using the following user-data:
#!/bin/bash
#Chef run list
cat << "EOF" > /etc/chef/node.json
{
"run_list": [
node[mycompany-webapp]"
]
}
EOF
sudo chef-solo -c /etc/chef/solo.rb -j /etc/chef/node.json -l debug > /home/ubuntu/startup.log && echo "Server ready." | wall

USING HOSTED CHEF OR CHEF SERVER IN PRODUCTION
    1. After testing the cookbook upload it to your Chef Server or the Opscode Hosted Chef platform using the Chef Workstation.

    2. For production the server automatically "pulls" and run the cookbooks. To do this simply configure the parameters in the user data:
#!/bin/bash
sudo chef-client -c /etc/chef/config.rb -N my_prod_node_name -l debug > /home/ubuntu/startup.log && echo "Server ready." | wall
and the server configures an apache web server at startup.

    3. Even in production when you have a large number of servers it can be useful to push the changes to a couple of servers and make sure the change is working correctly before committing the change to Hosted Chef and getting all the production servers to update.

References
    Chef: Patterns and Anti-Patterns for Cookbooks, Environments, Roles
Leveling Up on Chef Best Practices
    Chef Solo is great you might not need client server
    Our First Chef Cookbook
    Automated Deployments with LittleChef
    Info on ssh
    Chef installation and minimal configuration
    Automated Configuration Management with opscode
    Using Opscode Chef to start up a node on AWS EC2 - A Simple Example

0 comments:

Post a Comment