SlideShare a Scribd company logo
Modeling Infrastructure With Chef
Charles Johnson
• Product Engineer, Chef
• Career Sysadmin (~20 years)
• Opscode Chef Employee since 2012
• @chipadeedoodah
• charles@chef.io
Where Does Configuration Live?
Layers of Policy
Typical Boring Infrastructure
• Datacenter
(US-EAST)
Datacenter
Datacenter
Zone
Zone
Typical Boring Infrastructure
• Datacenter
(US-EAST)
• Zone / Shard / Replica
(US-EAST-1C)
Datacenter
Zone
Zone
Typical Boring Infrastructure
• Datacenter
(US-EAST)
• Zone / Shard / Replica
(US-EAST-1C)
• Logical / Lifecycle stage
(Dev/Stage/Prod)
Dev Stage Prod
Datacenter
Zone
Zone
Typical Boring Infrastructure
• Datacenter
(US-EAST)
• Zone / Shard / Replica
(US-EAST-1C)
• Logical / Lifecycle stage
(Dev/Stage/Prod)
• Hostgroup
(Web, App, Cache, DB, etc)
Dev Stage Prod
Web
App
Cache
DB
Web
App
Cache
DB
Web
App
Cache
DB
Datacenter
Zone
Zone
Typical Boring Infrastructure
• Datacenter
(US-EAST)
• Zone / Shard / Replica
(US-EAST-1C)
• Logical / Lifecycle stage
(Dev/Stage/Prod)
• Hostgroup
(Web, App, Cache, DB, etc)
• ... And one more place.
(Can you guess where?)
Dev Stage Prod
Web
App
Cache
DB
Web
App
Cache
DB
Web
App
Cache
DB
THE HOST?
THE “NO SNOWFLAKES” RULE
• Rule #1 of modeling infrastructure with
Chef: There Shall Be No Host-Specific
Configuration.
• That one server in the corner that
nobody touches because the person
who built it is long-gone and if that
server dies you’re all screwed? No
longer allowed.
• So where, then?
Datacenter
• Example Configuration / Policy:
• “All hosts in the US-EAST Datacenter must
be built from the US-EAST-RHEL image set.”
• “At least two independent failure domains
must be established inside the US-EAST
Datacenter.”
• All hosts in the US-EAST Datacenter must
have an active MTA. No MTA other than
Postfix will be allowed.”
• “All hosts in the US-EAST Datacenter must
deny remote-root logins via SSH.”
https://www.flickr.com/photos/photoblog0001/2219131561
Zone / Shard / Replica
• Example Configuration / Policy:
• “In order to comply with the failure domain
policy within the US-EAST Datacenter, all
configurations, policies, and changes in US-
EAST-1A must be duplicated locally in zone
US-EAST-1D.”
• “All hosts in each zone must use zone-local
DNS and NTP servers.”
https://www.flickr.com/photos/winnieshuman/3559464042/
Logical Stage
• Example Configuration / Policy:
• “All Development servers must route
outbound mail to /dev/null.”
• “All staging servers cannot run in debug log-
level for more than 6h.”
• “All Production servers must route outbound
mail through a specific named relay.”
https://www.flickr.com/photos/srkkiran/6096554915
Hostgroup
• Example Configuration / Policy:
• “All Web Servers must run NGINX.”
• “All Web Servers should have a specific SSL
certificate.”
• “All Web servers should listen on TCP ports
443 and 80.”
• “All Database servers should run
PostgreSQL.”
• “All monitoring servers must run Sensu.”
https://www.flickr.com/photos/mr_t_in_dc/4800819674
Datacenter
Zone
Zone
That Last Place Configuration Lives?
• Datacenter
(US-EAST)
• Zone / Shard / Replica
(US-EAST-1C)
• Logical / Lifecycle stage
(Dev/Stage/Prod)
• Hostgroup
(Web, App, Cache, DB, etc)
• The intersection of
Hostgroup + Logical
Dev Stage Prod
Web
App
Cache
DB
Web
App
Cache
DB
Web
App
Cache
DB
The Intersection of Hostgroup and Logical Stage
• Example Configuration / Policy:
• “All staging application servers must only
communicate with staging database
servers.”
• “No cross-stage communication may be
allowed.”
• Exceptions! “Development database servers
should be refreshed with replicated data
from production database servers every 72
hours.”
https://www.flickr.com/photos/collylogic/12620887894
Infrastructure Modeling With Chef
Available Primitives
Organizations
• Immutable & stateless
• Have no data or policy of their own
• Isolated / Sandboxed “tenants”
• Data cannot be shared between organizations
• Each has its own API endpoint and keys
• Container objects
• All other objects exist within an organization
• Can represent different companies, business units, departments, or even isolate
production from dev/stage.
Nodes
• Represent individual compute resources in the infrastructure (hosts)
• Have a single environment, and 0 or more roles
• Contain a run_list
• An order list of Chef recipes (programs) that will be executed on the node
• Contain attributes
• Store state data such as the default webserver ports
• Store information about the node, such as number of CPUs, block devices, runtimes, etc.
• Are their own SOA
• The node object in Chef is the sole authority for the configuration of the node.
• Autonomous individual nodes acting together correctly comprise a working, reliable
infrastructure.
Roles
• Collects multiple policies into a single object for easy duplication
• Contain a run_list
• An order list of Chef recipes (programs) that will be executed on the node
• Contain attributes
• Store state data such as the default webserver ports
• The relationships between role and node are defined at the node, not at the role.
Environments
• Have no run_list
• Contain attributes
• Store blanket policies such as “all nodes in this environment must behave in a particular way.”
• Can be used to version cookbook releases and model application lifecycle for
Chef code.
• The relationship between environment and node is defined at the node, not at
the environment.
Data Bags
• Collections of indexed data, stored in JSON format. “A hash table in the sky.”
• Can be read from and written to on the fly by Chef recipes.
• No drivers necessary, data bags are searchable from Chef code without any
additional libraries.
• Suitable for storing information that is true of the entire infrastructure, without
necessarily being true for any one individual node. eg. A list of users, a list of
current code version releases, etc.
Cookbooks
• Unit of code sharing in Chef: Thousands of existing cookbooks are available for
free on the Chef Supermarket repository!
• Contain executable code
• Recipes
• Libraries
• LWRPs
• Configuration file templates
• Contain Attributes
• Typically default data, such as “Web servers listen on TCP port 80.”
Example policies, modeled in Chef
Disclaimer: With Chef, there is almost always more than one way to do
anything. These are examples, not dogma.
All hosts must deny remote-root logins via SSH.
• Upload the OpenSSH cookbook from the Chef Supermarket to the Chef Server
• Create a “base” role that will be applied to all hosts as a default set of
configuration, regardless of environment
• Include “recipe[‘openssh::default’] in the role run_list
• Add an attribute to the role that sets the OpenSSH permitRootLogin value to ‘no’
• Modify the node object so that role[‘base’] is the first item in the run_list.
• Execute chef-client on the node.
Example roles/base.json file:
{
"name":"base",
"description":"Default run_list for the Krustylu Studios”,
"chef_type": "role”,
"default_attributes":{
"openssh":{
"server":{
"permit_root_login": "no"
}
}
},
"run_list":[
"recipe[openssh]"
],
}
All Production servers must use the Postfix MTA,
and must route outbound mail through a specific
named relay.
• Upload the Postfix cookbook from the Chef Supermarket to the Chef Server
• Add the postfix cookbook to the run_list in the previously created ‘base’ role
• Create a production environment
• Add an attribute that sets the Postfix remote relay to our specific named relay
• Modify the node object so that it is associated with the production environment.
• Execute chef-client on the node.
Example environments/production.json file:
{
"name": "production",
"description": "for production nodes",
"json_class": "Chef::Environment",
"chef_type": "environment",
"default_attributes": {
"postfix":{
"main":{
"relayhost": "my_external_relay.dns.local"
}
}
},
"cookbook_versions": {
}
}
Benefits
• Separating code (cookbooks) from configuration (roles, environments, etc.) leads
to greater re-use across teams, and allows teams to focus on their own domain
without interfering with others
• Quickly react to policy changes
• Centralize the flow of change into the infrastructure
• Chef has precedence rules for automatically layering conflicting configurations
together to create exceptions: “All production servers must use external DNS
except for machines on the TRUST VLAN segments.”
Wrapping Up
• Datacenter & IT Compute Infrastructure is typically modeled by subdividing
nodes into smaller groups
• Management and security policies typically exist at every layer
• These policies often intersect, complement, or conflict with one another, and
these must also be modeled.
• Chef provides primitives for accurately modeling all of these layers and
intersections of policy
Charles Johnson
• Product Engineer, Chef
• Career Sysadmin (~20 years)
• Opscode Chef Employee since 2012
• @chipadeedoodah
• charles@chef.io
Thanks!
Q&A?

More Related Content

What's hot

Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
jtimberman
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
Karthik .P.R
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Chef Software, Inc.
 
Chef introduction
Chef introductionChef introduction
Chef introduction
FENG Zhichao
 
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Josh Padnick
 
CommandBox REPL, CLI, and Package Manager
CommandBox REPL, CLI, and Package ManagerCommandBox REPL, CLI, and Package Manager
CommandBox REPL, CLI, and Package Manager
bdw429s
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
Jennifer Davis
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
Jeff Geerling
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
Jennifer Davis
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Software, Inc.
 
SaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOps
SaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOpsSaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOps
SaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOps
SaltStack
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
Jennifer Davis
 
Chef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK BoxChef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK Box
Chef Software, Inc.
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Software, Inc.
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
Johannes H. P. Skov Frandsen
 
Serverspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collideServerspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collide
m_richardson
 
Using SaltStack to DevOps the enterprise
Using SaltStack to DevOps the enterpriseUsing SaltStack to DevOps the enterprise
Using SaltStack to DevOps the enterprise
Christian McHugh
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1
Chef
 
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil DibowitzAtmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
PROIDEA
 

What's hot (20)

Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In CodeIntroduction to Chef: Automate Your Infrastructure by Modeling It In Code
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
 
CommandBox REPL, CLI, and Package Manager
CommandBox REPL, CLI, and Package ManagerCommandBox REPL, CLI, and Package Manager
CommandBox REPL, CLI, and Package Manager
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
SaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOps
SaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOpsSaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOps
SaltConf14 - Justin Carmony, Deseret Digital Media - Teaching Devs About DevOps
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
 
Chef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK BoxChef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK Box
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
Serverspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collideServerspec and Sensu - Testing and Monitoring collide
Serverspec and Sensu - Testing and Monitoring collide
 
Using SaltStack to DevOps the enterprise
Using SaltStack to DevOps the enterpriseUsing SaltStack to DevOps the enterprise
Using SaltStack to DevOps the enterprise
 
Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1Overview of Chef - Fundamentals Webinar Series Part 1
Overview of Chef - Fundamentals Webinar Series Part 1
 
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil DibowitzAtmosphere 2014: Really large scale systems configuration - Phil Dibowitz
Atmosphere 2014: Really large scale systems configuration - Phil Dibowitz
 

Viewers also liked

Automating secure server baselines with Chef
Automating secure server baselines with ChefAutomating secure server baselines with Chef
Automating secure server baselines with Chef
Chef Software, Inc.
 
Scaling Cassandra for Big Data
Scaling Cassandra for Big DataScaling Cassandra for Big Data
Scaling Cassandra for Big DataDataStax Academy
 
DataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenter
DataStax Academy
 
Aggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of dataAggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of data
Rostislav Pashuto
 
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
Animesh Singh
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Erica Windisch
 

Viewers also liked (6)

Automating secure server baselines with Chef
Automating secure server baselines with ChefAutomating secure server baselines with Chef
Automating secure server baselines with Chef
 
Scaling Cassandra for Big Data
Scaling Cassandra for Big DataScaling Cassandra for Big Data
Scaling Cassandra for Big Data
 
DataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenter
 
Aggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of dataAggregated queries with Druid on terrabytes and petabytes of data
Aggregated queries with Druid on terrabytes and petabytes of data
 
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
CAPS: What's best for deploying and managing OpenStack? Chef vs. Ansible vs. ...
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
 

Similar to Infrastructure modeling with chef

Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
Ygor Nascimento
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowTXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
Matt Ray
 
Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for OpenstackMohit Sethi
 
HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...
HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...
HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...
Cloudera, Inc.
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
John Osborne
 
Beyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy serverBeyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy server
NASIG
 
Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18
BIWUG
 
Configuration management with Chef
Configuration management with ChefConfiguration management with Chef
Configuration management with Chef
Juan Vicente Herrera Ruiz de Alejo
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
kevsmith
 
Deployment and Configuration 3.7
Deployment and Configuration 3.7Deployment and Configuration 3.7
Deployment and Configuration 3.7
StephenKardian
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!Ben Steinhauser
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Nathen Harvey
 
SCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStackSCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStack
Matt Ray
 
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Stephen Gordon
 
MIgrating to RAC using Dataguard
MIgrating to RAC  using Dataguard MIgrating to RAC  using Dataguard
MIgrating to RAC using Dataguard Fuad Arshad
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
All Things Open
 
Compliance Automation with InSpec
Compliance Automation with InSpecCompliance Automation with InSpec
Compliance Automation with InSpec
Nathen Harvey
 
Chef for OpenStack December 2012
Chef for OpenStack December 2012Chef for OpenStack December 2012
Chef for OpenStack December 2012
Matt Ray
 

Similar to Infrastructure modeling with chef (20)

Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
 
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & TomorrowTXLF: Chef- Software Defined Infrastructure Today & Tomorrow
TXLF: Chef- Software Defined Infrastructure Today & Tomorrow
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
 
Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
 
HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...
HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...
HBaseCon 2012 | HBase Coprocessors – Deploy Shared Functionality Directly on ...
 
Sharepoint Deployments
Sharepoint DeploymentsSharepoint Deployments
Sharepoint Deployments
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
 
Beyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy serverBeyond 'Set it and Forget it': Proactively managing your EZproxy server
Beyond 'Set it and Forget it': Proactively managing your EZproxy server
 
Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18Pascal benois performance_troubleshooting-spsbe18
Pascal benois performance_troubleshooting-spsbe18
 
Configuration management with Chef
Configuration management with ChefConfiguration management with Chef
Configuration management with Chef
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Deployment and Configuration 3.7
Deployment and Configuration 3.7Deployment and Configuration 3.7
Deployment and Configuration 3.7
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
SCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStackSCALE12X: Chef for OpenStack
SCALE12X: Chef for OpenStack
 
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)Deep Dive: OpenStack Summit (Red Hat Summit 2014)
Deep Dive: OpenStack Summit (Red Hat Summit 2014)
 
MIgrating to RAC using Dataguard
MIgrating to RAC  using Dataguard MIgrating to RAC  using Dataguard
MIgrating to RAC using Dataguard
 
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to ChefIntroduction to Infrastructure as Code & Automation / Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
 
Compliance Automation with InSpec
Compliance Automation with InSpecCompliance Automation with InSpec
Compliance Automation with InSpec
 
Chef for OpenStack December 2012
Chef for OpenStack December 2012Chef for OpenStack December 2012
Chef for OpenStack December 2012
 

Recently uploaded

TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Hivelance Technology
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
NaapbooksPrivateLimi
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
XfilesPro
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 

Recently uploaded (20)

TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Visitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.appVisitor Management System in India- Vizman.app
Visitor Management System in India- Vizman.app
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 

Infrastructure modeling with chef

  • 1.
  • 3. Charles Johnson • Product Engineer, Chef • Career Sysadmin (~20 years) • Opscode Chef Employee since 2012 • @chipadeedoodah • charles@chef.io
  • 4. Where Does Configuration Live? Layers of Policy
  • 5. Typical Boring Infrastructure • Datacenter (US-EAST) Datacenter
  • 6. Datacenter Zone Zone Typical Boring Infrastructure • Datacenter (US-EAST) • Zone / Shard / Replica (US-EAST-1C)
  • 7. Datacenter Zone Zone Typical Boring Infrastructure • Datacenter (US-EAST) • Zone / Shard / Replica (US-EAST-1C) • Logical / Lifecycle stage (Dev/Stage/Prod) Dev Stage Prod
  • 8. Datacenter Zone Zone Typical Boring Infrastructure • Datacenter (US-EAST) • Zone / Shard / Replica (US-EAST-1C) • Logical / Lifecycle stage (Dev/Stage/Prod) • Hostgroup (Web, App, Cache, DB, etc) Dev Stage Prod Web App Cache DB Web App Cache DB Web App Cache DB
  • 9. Datacenter Zone Zone Typical Boring Infrastructure • Datacenter (US-EAST) • Zone / Shard / Replica (US-EAST-1C) • Logical / Lifecycle stage (Dev/Stage/Prod) • Hostgroup (Web, App, Cache, DB, etc) • ... And one more place. (Can you guess where?) Dev Stage Prod Web App Cache DB Web App Cache DB Web App Cache DB
  • 11. THE “NO SNOWFLAKES” RULE • Rule #1 of modeling infrastructure with Chef: There Shall Be No Host-Specific Configuration. • That one server in the corner that nobody touches because the person who built it is long-gone and if that server dies you’re all screwed? No longer allowed. • So where, then?
  • 12. Datacenter • Example Configuration / Policy: • “All hosts in the US-EAST Datacenter must be built from the US-EAST-RHEL image set.” • “At least two independent failure domains must be established inside the US-EAST Datacenter.” • All hosts in the US-EAST Datacenter must have an active MTA. No MTA other than Postfix will be allowed.” • “All hosts in the US-EAST Datacenter must deny remote-root logins via SSH.” https://www.flickr.com/photos/photoblog0001/2219131561
  • 13. Zone / Shard / Replica • Example Configuration / Policy: • “In order to comply with the failure domain policy within the US-EAST Datacenter, all configurations, policies, and changes in US- EAST-1A must be duplicated locally in zone US-EAST-1D.” • “All hosts in each zone must use zone-local DNS and NTP servers.” https://www.flickr.com/photos/winnieshuman/3559464042/
  • 14. Logical Stage • Example Configuration / Policy: • “All Development servers must route outbound mail to /dev/null.” • “All staging servers cannot run in debug log- level for more than 6h.” • “All Production servers must route outbound mail through a specific named relay.” https://www.flickr.com/photos/srkkiran/6096554915
  • 15. Hostgroup • Example Configuration / Policy: • “All Web Servers must run NGINX.” • “All Web Servers should have a specific SSL certificate.” • “All Web servers should listen on TCP ports 443 and 80.” • “All Database servers should run PostgreSQL.” • “All monitoring servers must run Sensu.” https://www.flickr.com/photos/mr_t_in_dc/4800819674
  • 16. Datacenter Zone Zone That Last Place Configuration Lives? • Datacenter (US-EAST) • Zone / Shard / Replica (US-EAST-1C) • Logical / Lifecycle stage (Dev/Stage/Prod) • Hostgroup (Web, App, Cache, DB, etc) • The intersection of Hostgroup + Logical Dev Stage Prod Web App Cache DB Web App Cache DB Web App Cache DB
  • 17. The Intersection of Hostgroup and Logical Stage • Example Configuration / Policy: • “All staging application servers must only communicate with staging database servers.” • “No cross-stage communication may be allowed.” • Exceptions! “Development database servers should be refreshed with replicated data from production database servers every 72 hours.” https://www.flickr.com/photos/collylogic/12620887894
  • 18. Infrastructure Modeling With Chef Available Primitives
  • 19. Organizations • Immutable & stateless • Have no data or policy of their own • Isolated / Sandboxed “tenants” • Data cannot be shared between organizations • Each has its own API endpoint and keys • Container objects • All other objects exist within an organization • Can represent different companies, business units, departments, or even isolate production from dev/stage.
  • 20. Nodes • Represent individual compute resources in the infrastructure (hosts) • Have a single environment, and 0 or more roles • Contain a run_list • An order list of Chef recipes (programs) that will be executed on the node • Contain attributes • Store state data such as the default webserver ports • Store information about the node, such as number of CPUs, block devices, runtimes, etc. • Are their own SOA • The node object in Chef is the sole authority for the configuration of the node. • Autonomous individual nodes acting together correctly comprise a working, reliable infrastructure.
  • 21. Roles • Collects multiple policies into a single object for easy duplication • Contain a run_list • An order list of Chef recipes (programs) that will be executed on the node • Contain attributes • Store state data such as the default webserver ports • The relationships between role and node are defined at the node, not at the role.
  • 22. Environments • Have no run_list • Contain attributes • Store blanket policies such as “all nodes in this environment must behave in a particular way.” • Can be used to version cookbook releases and model application lifecycle for Chef code. • The relationship between environment and node is defined at the node, not at the environment.
  • 23. Data Bags • Collections of indexed data, stored in JSON format. “A hash table in the sky.” • Can be read from and written to on the fly by Chef recipes. • No drivers necessary, data bags are searchable from Chef code without any additional libraries. • Suitable for storing information that is true of the entire infrastructure, without necessarily being true for any one individual node. eg. A list of users, a list of current code version releases, etc.
  • 24. Cookbooks • Unit of code sharing in Chef: Thousands of existing cookbooks are available for free on the Chef Supermarket repository! • Contain executable code • Recipes • Libraries • LWRPs • Configuration file templates • Contain Attributes • Typically default data, such as “Web servers listen on TCP port 80.”
  • 25. Example policies, modeled in Chef Disclaimer: With Chef, there is almost always more than one way to do anything. These are examples, not dogma.
  • 26. All hosts must deny remote-root logins via SSH. • Upload the OpenSSH cookbook from the Chef Supermarket to the Chef Server • Create a “base” role that will be applied to all hosts as a default set of configuration, regardless of environment • Include “recipe[‘openssh::default’] in the role run_list • Add an attribute to the role that sets the OpenSSH permitRootLogin value to ‘no’ • Modify the node object so that role[‘base’] is the first item in the run_list. • Execute chef-client on the node.
  • 27. Example roles/base.json file: { "name":"base", "description":"Default run_list for the Krustylu Studios”, "chef_type": "role”, "default_attributes":{ "openssh":{ "server":{ "permit_root_login": "no" } } }, "run_list":[ "recipe[openssh]" ], }
  • 28. All Production servers must use the Postfix MTA, and must route outbound mail through a specific named relay. • Upload the Postfix cookbook from the Chef Supermarket to the Chef Server • Add the postfix cookbook to the run_list in the previously created ‘base’ role • Create a production environment • Add an attribute that sets the Postfix remote relay to our specific named relay • Modify the node object so that it is associated with the production environment. • Execute chef-client on the node.
  • 29. Example environments/production.json file: { "name": "production", "description": "for production nodes", "json_class": "Chef::Environment", "chef_type": "environment", "default_attributes": { "postfix":{ "main":{ "relayhost": "my_external_relay.dns.local" } } }, "cookbook_versions": { } }
  • 30. Benefits • Separating code (cookbooks) from configuration (roles, environments, etc.) leads to greater re-use across teams, and allows teams to focus on their own domain without interfering with others • Quickly react to policy changes • Centralize the flow of change into the infrastructure • Chef has precedence rules for automatically layering conflicting configurations together to create exceptions: “All production servers must use external DNS except for machines on the TRUST VLAN segments.”
  • 31. Wrapping Up • Datacenter & IT Compute Infrastructure is typically modeled by subdividing nodes into smaller groups • Management and security policies typically exist at every layer • These policies often intersect, complement, or conflict with one another, and these must also be modeled. • Chef provides primitives for accurately modeling all of these layers and intersections of policy
  • 32. Charles Johnson • Product Engineer, Chef • Career Sysadmin (~20 years) • Opscode Chef Employee since 2012 • @chipadeedoodah • charles@chef.io