everything as a cookbook

22
WHO IS THIS GUY? Tom Duffield Automation Consulting Engineer with Chef [email protected] @tomduffield tduffield tomduffield.com

Upload: tomduffield

Post on 27-Jan-2015

105 views

Category:

Technology


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Everything as a Cookbook

WHO IS THIS GUY?

Tom Duffield Automation Consulting Engineer with Chef

[email protected]

@tomduffield

tduffield

tomduffield.com

Page 2: Everything as a Cookbook

EVERYTHING AS A COOKBOOKService Oriented Thinking for your Code

Page 3: Everything as a Cookbook

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.

Page 4: Everything as a Cookbook

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”

Page 5: Everything as a Cookbook

– Average new Chef user

“What is the correct way to write a cookbook?”

Page 6: Everything as a Cookbook

– Many intermediate Chef users

“When should I use a custom resource?”

Page 7: Everything as a Cookbook

– Most advanced Chef users

Page 8: Everything as a Cookbook

AVOID OVER ENGINEERING

http://xkcd.com/1205/

Page 9: Everything as a Cookbook

When a framework is designed to be flexible, how do you define best practices?

Page 10: Everything as a Cookbook

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.

Page 11: Everything as a Cookbook

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.

Page 12: Everything as a Cookbook

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

Page 13: 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

Page 14: Everything as a Cookbook

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.

Page 15: Everything as a Cookbook

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.

Page 16: Everything as a Cookbook

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

Page 17: 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.

Page 18: Everything as a Cookbook

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.

Page 19: Everything as a Cookbook

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.

Page 20: Everything as a Cookbook

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.

Page 21: Everything as a Cookbook

THANK YOU

Page 22: Everything as a Cookbook

QUESTIONS?