everything as a cookbook
Post on 27-Jan-2015
112 Views
Preview:
DESCRIPTION
TRANSCRIPT
WHO IS THIS GUY?
Tom Duffield Automation Consulting Engineer with Chef
tom@getchef.com
@tomduffield
tduffield
tomduffield.com
EVERYTHING AS A COOKBOOKService Oriented Thinking for your Code
QUICK INTRO TO CHEF• Automation platform that uses a Ruby DSL
to define actions to take on a node.
• These actions are defined using a construct called a resource.
• Chef comes with a set of core resources but custom resources can also be created.
• Resources are declared in logical groupings called recipes. Recipes are then packaged into cookbooks with other relevant code and distributed.
THE SITUATION
• Top-notch community that is constantly innovating.
• Growing base of users with very little development experience.
• Increasing interest for prescriptive methodologies, or “best practices”
– Average new Chef user
“What is the correct way to write a cookbook?”
– Many intermediate Chef users
“When should I use a custom resource?”
– Most advanced Chef users
When a framework is designed to be flexible, how do you define best practices?
When a framework is designed to be flexible, how do you define best practices?
Break the framework up into services.Create “best practices” for those services.
CLOUD COMPUTING
Infrastructure as a Service
Platform as a Service
Software as a ServiceImplementation of a platform that delivers a working application.
Customizable execution environment.
Basic building blocks for computing.
Infrastructure (as a) Cookbook
Platform (as a) Cookbook
Application (as a) CookbookImplementation of a platform that delivers a working application.
Customizable execution environment.
Basic building blocks for computing.
EVERYTHING AS A COOKBOOK
INFRASTRUCTURE (AS A) COOKBOOK• Manages the basic building blocks of your server.
• Operating System - package managers like yum, core services like ntp and cron, etc.
• Storage - LVM, RAID, etc.
• Networking - hosts files, DNS, firewalls, route tables, etc.
• Programming Languages - php, perl, ruby, java, etc.
• Libraries - Chef runtime libraries like Chef Sugar, system libraries like make, gcc
PLATFORM (AS A) COOKBOOK• Manages execution environment
• Execution Runtime - tomcat, nodejs, rails, etc.
• Web Server - apache2, nginx, etc.
• Database - mysql, postgresql, riak, cassandra, etc.
• Monitoring - sensu, zabbix, nagios, etc.
APPLICATION (AS A) COOKBOOK
• Manages the implementation of a platform that delivers a working application.
• Typically not sharable.
• Associated one-to-one with an application - website, api, etc.
Infrastructure (as a) Cookbook
Platform (as a) Cookbook
Application (as a) CookbookImplementation of a platform that delivers a working application.
Customizable execution environment.
Basic building blocks for computing.
EVERYTHING AS A COOKBOOK
INFRASTRUCTURE (AS A) COOKBOOK
• Recipes typically leverage only core Chef resources for installation of core functionality.
• Custom resources allow for additional functionality or implementation-specific configuration.
PLATFORM (AS A) COOKBOOK
• Recipes use a combination of core and custom resources to configure the system to provide core functionality.
• Custom resources allow for more advanced customization of execution environment.
APPLICATION (AS A) COOKBOOK
• Leverages custom resources exposed by Infrastructure and Platform cookbooks in addition to core Chef resources.
• Each recipe is responsible for one tier - app, data, cache, etc.
CONCLUSION
• Cookbooks can be placed in one of three categories: • Infrastructure as a Cookbook • Platform as a Cookbook • Application as a Cookbook
• Best practices can be created for these categories.
THANK YOU
QUESTIONS?
top related