everything as a cookbook
DESCRIPTION
TRANSCRIPT
![Page 1: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/1.jpg)
WHO IS THIS GUY?
Tom Duffield Automation Consulting Engineer with Chef
@tomduffield
tduffield
tomduffield.com
![Page 2: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/2.jpg)
EVERYTHING AS A COOKBOOKService Oriented Thinking for your Code
![Page 3: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/3.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/4.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/5.jpg)
– Average new Chef user
“What is the correct way to write a cookbook?”
![Page 6: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/6.jpg)
– Many intermediate Chef users
“When should I use a custom resource?”
![Page 7: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/7.jpg)
– Most advanced Chef users
![Page 9: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/9.jpg)
When a framework is designed to be flexible, how do you define best practices?
![Page 10: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/10.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/11.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/12.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/13.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/14.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/15.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/16.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/17.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/18.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/19.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/20.jpg)
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](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/21.jpg)
THANK YOU
![Page 22: Everything as a Cookbook](https://reader037.vdocuments.mx/reader037/viewer/2022110115/54c688eb4a7959a2128b4668/html5/thumbnails/22.jpg)
QUESTIONS?