SlideShare uma empresa Scribd logo
1 de 53
ChefInfrastructure as code
Chef
Background Opscode (HJK Solutions)
Chef has Recipes Resources Roles Nodes Cookbooks Knife
Fully Automated Infrastructure
Provisioning Bare-metal: Kickstart/jumpstart VM: libvert Cloud: AWS/vCloud Cloud: fog (http://fog.io/)
Configuration Management
Systems Integration the last mile of fully automated infrastructure Metadata stored & indexed Search API
Chef principles Idempotent Thick Clients, Thin Server Order Matters
Why chef? Economics Efficiency Scalability Community
Flavors of Chef Chef client & Chef server Hosted Chef Chef solo
Architecture
A Chef run
Chef client     Client does all the work, and can run recipes for multiple Nodes.
Chef server API service. Management Console (optional). AMQP Server Search indexer and Search Engine. Data store with CouchDB.
Chef solo -c, --config CONFIG -j, --json-attributes JSON_ATTRIBS -r, --recipe-url RECIPE_URL
Cookbook
Cookbook     Cookbooks are the fundamental units of distribution in Chef.
Cookbook attributes/ definitions/ files/ libraries/ metadata.rb providers/ recipes/ resources/ templates/
Cookbook Dev in chef-repo Create our own cookbook Or download from community Upload to Chef server
Cookbook command knife cookbook list knife cookbook create COOKBOOK knife cookbook download COOKBOOK knife cookbook upload [COOKBOOKS...] knife cookbook delete COOKBOOK knife cookbook metadata COOKBOOK
 Chef Community Cookbook Site  knife cookbook site list knife cookbook site share COOKBOOK CATEGORY knife cookbook site install COOKBOOK knife cookbook site unshare COOKBOOK knife cookbook site search QUERY knife cookbook site download COOKBOOK
Cookbook Dependencies  In metadata.rb: depends "apache2", ">= 0.99.4" depends "mysql", ">= 1.0.5"
Attributes node.default[:apache][:dir] = "/etc/apache2" node.default[:apache][:listen_ports] = [ "80", "443" ] if node.apache.attribute?(”dir")   # do something end
Nodes Nodes in Chef are the thing that are configured by Recipes.  recipe/role attribute
Roles name "webserver" description "The base role for systems that serve HTTP traffic" run_list "recipe[apache2]", "recipe[apache2::mod_ssl]", "role[monitor]" env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"] default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] } override_attributes "apache2" => { "max_children" => "50" }
Search knife search node "id:foo OR id:abc” search(:node, 'run_list:recipefoobar') do |matching_node|   puts matching_node.to_s end
Libraries your_cookbook/libraries/your_example_library.rb module YourExampleLibrary   def your_function()     # ... do something useful     end End your_cookbook/recipes/default.rb class Chef::Recipe   include YourExampleLibrary end your_function()
Metadata maintainter "bob" maintainer_email "bob@gmail.com" license "Apache v2.0" description "A cookbook" long_description "blablabla" depends "mysql", ">= 1.0.1" version "2.0.1" recipe "A recipe", "blablabla"
Templates template "/etc/sudoers" do   source "sudoers.erb"   mode 0440   owner "root"   group "root"   variables(     :sudoers_groups => node[:authorization][:sudo][:groups],     :sudoers_users => node[:authorization][:sudo][:users]   ) end
Recipes stored in Cookbooks. executed in the order they appear. evaluated as Ruby code. Recipes from other Cookbooks can be included with include_recipe. All the attributes of the current Node are available via the node object.
Resources such as: packages services users files directories
Resources: cookbook_file cookbook_file "/tmp/testfile" do   source "testfile" # this is the value that would be inferred from the path parameter   mode "0644" end
Resources: directory %w{dir1 dir2 dir3}.each do |dir|    directory "/tmp/mydirs/#{dir}" do       mode 0775       owner "root"       group "root"       action :create       recursive true    end end
Resources: remote file remote_file "/tmp/testfile" do   source "http://www.example.com/tempfiles/testfile"   mode "0644"   checksum "08da002l" # A SHA256 (or portion thereof) of the file. end
Resources: package package "tar" do   version "1.16.1-1"   action :install end
Resources: script script "install_something" do   interpreter "bash"   user "root" cwd "/tmp"   code <<-EOH wget http://www.example.com/tarball.tar.gz   tar -zxftarball.tar.gz cdtarball   ./configure   make   make install   EOH end
Quick start
Quick Start ,[object Object]
Local workstation(MaxOSX)
One node(VM Ubuntu),[object Object],[object Object]
Workstation Setup ,[object Object],         - Ruby 1.8.7+              - RubyGems1.3.7+ ,[object Object]
Create Chef repository            - gitclone git://github.com/opscode/chef-repo.git ,[object Object],             - Create .chef directory               - Copy the private keys and knife cpUSERNAME.pem ~/chef-repo/.chef cpORGANIZATION-validator.pem ~/chef-repo/.chef cpknife.rb ~/chef-repo/.chef
Set up a node as Chef Client ,[object Object],      knife cookbook site install chef-client ,[object Object],knife cookbook upload ,[object Object],knife bootstrap 10.1.1.110 -r 'recipe[chef-client]' –x          username –P password --sudo
Verify node data List all the node:  knife node list List the run list for a specific node: knife node show nodename –r
Working with git
get chef-repo git clone git://github.com/opscode/chef-repo.git
repo tree config/ - Contains the Rake configuration file, rake.rb. cookbooks/ - Cookbooks you download or create. data_bags/ - Store data bags and items in .json in the repository. roles/ - Store roles in .rb or .json in the repository. certificates/ - SSL certificates generated by rake ssl_cert live here.
working with git Building a new cookbook and saving it to the local repository. Downloading an existing cookbook from the Chef Community Site. Modifying an existing cookbook in the local repository for new updates.
Doc & Help
working with git wik: http://wiki.opscode.com/display/chef/Home community:     http://community.opscode.com/cookbooks

Mais conteúdo relacionado

Mais procurados

Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local ModeMichael Goetz
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Software, Inc.
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Software, Inc.
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to ChefKnoldus Inc.
 
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 CodeJosh Padnick
 
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.
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Pravin Mishra
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as CodeMatt Ray
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Jennifer Davis
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitJennifer Davis
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesMamun Rashid, CCDH
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Software, Inc.
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Chef
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshopjtimberman
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Chef
 

Mais procurados (20)

Chef-Zero & Local Mode
Chef-Zero & Local ModeChef-Zero & Local Mode
Chef-Zero & Local Mode
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
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
 
Understand Chef
Understand ChefUnderstand Chef
Understand Chef
 
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
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Chef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS NewbiesChef Tutorial for DEVOPS Newbies
Chef Tutorial for DEVOPS Newbies
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Velocity2011 chef-workshop
Velocity2011 chef-workshopVelocity2011 chef-workshop
Velocity2011 chef-workshop
 
Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
 

Destaque

Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an IntroductionSanjeev Sharma
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the MassesSai Perchard
 
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 ChefAll Things Open
 
Infrastructure as Code with Chef
Infrastructure as Code with ChefInfrastructure as Code with Chef
Infrastructure as Code with ChefSarah Hynes Cheney
 
พิชญานิน แผ่นพับ
พิชญานิน แผ่นพับพิชญานิน แผ่นพับ
พิชญานิน แผ่นพับchisuminho
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerMandi Walls
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott RusselKangaroot
 
Infrastructure Automation How to Use Chef For DevOps Success
Infrastructure Automation How to Use Chef For DevOps SuccessInfrastructure Automation How to Use Chef For DevOps Success
Infrastructure Automation How to Use Chef For DevOps SuccessDynatrace
 
The professional chef
The professional chefThe professional chef
The professional chefkellimccabe
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationJulian Dunn
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeAmazon Web Services
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with ChefAdam Jacob
 
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) - DevopsDaysPGHErica Windisch
 

Destaque (17)

Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an Introduction
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
 
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
 
Chef For OpenStack Overview
Chef For OpenStack OverviewChef For OpenStack Overview
Chef For OpenStack Overview
 
Infrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / PuppetInfrastructure as Code with Chef / Puppet
Infrastructure as Code with Chef / Puppet
 
Infrastructure as Code with Chef
Infrastructure as Code with ChefInfrastructure as Code with Chef
Infrastructure as Code with Chef
 
พิชญานิน แผ่นพับ
พิชญานิน แผ่นพับพิชญานิน แผ่นพับ
พิชญานิน แผ่นพับ
 
Chef in a nutshell
Chef in a nutshellChef in a nutshell
Chef in a nutshell
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and Docker
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott Russel
 
Infrastructure Automation How to Use Chef For DevOps Success
Infrastructure Automation How to Use Chef For DevOps SuccessInfrastructure Automation How to Use Chef For DevOps Success
Infrastructure Automation How to Use Chef For DevOps Success
 
The professional chef
The professional chefThe professional chef
The professional chef
 
Chef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous IntegrationChef Cookbook Testing and Continuous Integration
Chef Cookbook Testing and Continuous Integration
 
Deep Dive - Infrastructure as Code
Deep Dive - Infrastructure as CodeDeep Dive - Infrastructure as Code
Deep Dive - Infrastructure as Code
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
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
 
DevOps and Chef
DevOps and ChefDevOps and Chef
DevOps and Chef
 

Semelhante a Chef introduction

Cook Infrastructure with chef -- Justeat.IN
Cook Infrastructure with chef  -- Justeat.INCook Infrastructure with chef  -- Justeat.IN
Cook Infrastructure with chef -- Justeat.INRajesh Hegde
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef frameworkmorgoth
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefAntons Kranga
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for ussickill
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef OpsworkHamza Waqas
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chefkevsmith
 
Chef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rbChef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rbNicolas Ledez
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode ChefSri Ram
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlabChef
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode ChefSri Ram
 
Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef
 
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013Amazon Web Services
 
Introduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & RemediationIntroduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & RemediationNicole Johnson
 
How to Write Chef Cookbook
How to Write Chef CookbookHow to Write Chef Cookbook
How to Write Chef Cookbookdevopsjourney
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode ChefSri Ram
 

Semelhante a Chef introduction (20)

Cook Infrastructure with chef -- Justeat.IN
Cook Infrastructure with chef  -- Justeat.INCook Infrastructure with chef  -- Justeat.IN
Cook Infrastructure with chef -- Justeat.IN
 
Chef
ChefChef
Chef
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 
IT Automation with Chef
IT Automation with ChefIT Automation with Chef
IT Automation with Chef
 
Chef or how to make computers do the work for us
Chef or how to make computers do the work for usChef or how to make computers do the work for us
Chef or how to make computers do the work for us
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Chef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rbChef infrastructure as code - paris.rb
Chef infrastructure as code - paris.rb
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Azure handsonlab
Azure handsonlabAzure handsonlab
Azure handsonlab
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015Chef Provisioning a Chef Server Cluster - ChefConf 2015
Chef Provisioning a Chef Server Cluster - ChefConf 2015
 
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
AWS OpsWorks Under the Hood (DMG304) | AWS re:Invent 2013
 
Introduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & RemediationIntroduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & Remediation
 
How to Write Chef Cookbook
How to Write Chef CookbookHow to Write Chef Cookbook
How to Write Chef Cookbook
 
Chef
ChefChef
Chef
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
Chef training - Day2
Chef training - Day2Chef training - Day2
Chef training - Day2
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
 

Último

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Chef introduction

  • 4. Chef has Recipes Resources Roles Nodes Cookbooks Knife
  • 6. Provisioning Bare-metal: Kickstart/jumpstart VM: libvert Cloud: AWS/vCloud Cloud: fog (http://fog.io/)
  • 8. Systems Integration the last mile of fully automated infrastructure Metadata stored & indexed Search API
  • 9. Chef principles Idempotent Thick Clients, Thin Server Order Matters
  • 10. Why chef? Economics Efficiency Scalability Community
  • 11. Flavors of Chef Chef client & Chef server Hosted Chef Chef solo
  • 13.
  • 15.
  • 16. Chef client Client does all the work, and can run recipes for multiple Nodes.
  • 17. Chef server API service. Management Console (optional). AMQP Server Search indexer and Search Engine. Data store with CouchDB.
  • 18. Chef solo -c, --config CONFIG -j, --json-attributes JSON_ATTRIBS -r, --recipe-url RECIPE_URL
  • 20. Cookbook Cookbooks are the fundamental units of distribution in Chef.
  • 21. Cookbook attributes/ definitions/ files/ libraries/ metadata.rb providers/ recipes/ resources/ templates/
  • 22. Cookbook Dev in chef-repo Create our own cookbook Or download from community Upload to Chef server
  • 23. Cookbook command knife cookbook list knife cookbook create COOKBOOK knife cookbook download COOKBOOK knife cookbook upload [COOKBOOKS...] knife cookbook delete COOKBOOK knife cookbook metadata COOKBOOK
  • 24. Chef Community Cookbook Site knife cookbook site list knife cookbook site share COOKBOOK CATEGORY knife cookbook site install COOKBOOK knife cookbook site unshare COOKBOOK knife cookbook site search QUERY knife cookbook site download COOKBOOK
  • 25. Cookbook Dependencies In metadata.rb: depends "apache2", ">= 0.99.4" depends "mysql", ">= 1.0.5"
  • 26. Attributes node.default[:apache][:dir] = "/etc/apache2" node.default[:apache][:listen_ports] = [ "80", "443" ] if node.apache.attribute?(”dir") # do something end
  • 27. Nodes Nodes in Chef are the thing that are configured by Recipes. recipe/role attribute
  • 28. Roles name "webserver" description "The base role for systems that serve HTTP traffic" run_list "recipe[apache2]", "recipe[apache2::mod_ssl]", "role[monitor]" env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"] default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] } override_attributes "apache2" => { "max_children" => "50" }
  • 29. Search knife search node "id:foo OR id:abc” search(:node, 'run_list:recipefoobar') do |matching_node| puts matching_node.to_s end
  • 30. Libraries your_cookbook/libraries/your_example_library.rb module YourExampleLibrary def your_function() # ... do something useful end End your_cookbook/recipes/default.rb class Chef::Recipe include YourExampleLibrary end your_function()
  • 31. Metadata maintainter "bob" maintainer_email "bob@gmail.com" license "Apache v2.0" description "A cookbook" long_description "blablabla" depends "mysql", ">= 1.0.1" version "2.0.1" recipe "A recipe", "blablabla"
  • 32. Templates template "/etc/sudoers" do source "sudoers.erb" mode 0440 owner "root" group "root" variables( :sudoers_groups => node[:authorization][:sudo][:groups], :sudoers_users => node[:authorization][:sudo][:users] ) end
  • 33. Recipes stored in Cookbooks. executed in the order they appear. evaluated as Ruby code. Recipes from other Cookbooks can be included with include_recipe. All the attributes of the current Node are available via the node object.
  • 34. Resources such as: packages services users files directories
  • 35. Resources: cookbook_file cookbook_file "/tmp/testfile" do source "testfile" # this is the value that would be inferred from the path parameter mode "0644" end
  • 36. Resources: directory %w{dir1 dir2 dir3}.each do |dir| directory "/tmp/mydirs/#{dir}" do mode 0775 owner "root" group "root" action :create recursive true end end
  • 37. Resources: remote file remote_file "/tmp/testfile" do source "http://www.example.com/tempfiles/testfile" mode "0644" checksum "08da002l" # A SHA256 (or portion thereof) of the file. end
  • 38. Resources: package package "tar" do version "1.16.1-1" action :install end
  • 39. Resources: script script "install_something" do interpreter "bash" user "root" cwd "/tmp" code <<-EOH wget http://www.example.com/tarball.tar.gz tar -zxftarball.tar.gz cdtarball ./configure make make install EOH end
  • 41.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47. Verify node data List all the node: knife node list List the run list for a specific node: knife node show nodename –r
  • 49. get chef-repo git clone git://github.com/opscode/chef-repo.git
  • 50. repo tree config/ - Contains the Rake configuration file, rake.rb. cookbooks/ - Cookbooks you download or create. data_bags/ - Store data bags and items in .json in the repository. roles/ - Store roles in .rb or .json in the repository. certificates/ - SSL certificates generated by rake ssl_cert live here.
  • 51. working with git Building a new cookbook and saving it to the local repository. Downloading an existing cookbook from the Chef Community Site. Modifying an existing cookbook in the local repository for new updates.
  • 53. working with git wik: http://wiki.opscode.com/display/chef/Home community: http://community.opscode.com/cookbooks

Notas do Editor

  1. Manage your servers by writing code, not by running commands. With Chef, you write abstract definitions as source code to describe how you want each part of your infrastructure to be built, and then apply those descriptions to individual servers. The result is a fully automated infrastructure: when a new server comes on line, the only thing you have to do is tell Chef what role it should play in your architecture.
  2. Recipes: written in ruby using DSL. A Recipe describes a series of resources that should be in a particular state on a particular part of a server (such as Apache, MySQL, or Hadoop).Resource: A resource is usually a cross platform abstraction of the thing you&apos;re configuring on the host.A role sets a list of recipes and attributes to apply to a nodeA cookbook is a collection of recipes.Knife is the command line interface to the Chef server
  3. Kickstart: a file for installation questionsLibvert: The virtualization API, XEN, VMWare, Vitural Box, KVM…Amazon Web Services/Elastic Computer CloudFog: Ruby cloud services library
  4. Chef recipes can be data driven thereby providing dynamic system integration between servers. For example, when configuring a web server the search API can be called to discover the database and memcache servers and then automatically update the web server’s configuration. Likewise a load balancer recipe can automatically add the web servers into its configuration.
  5. Chef ensures that actions are not performed if the resources have not changedThe Chef Server is built to handle the easy distribution of data to the clients - the recipes to build, templates to render, files to transfer - along with storing the state of each Node.given the same set of Cookbooks, Chef will always execute your resources in the same order.
  6. Chef Solo: is a client application that works entirely from on-disk data, and is a light-weight alternative to a full client-server configuration.Chef Client: is the client application that works with a Chef Server to persist data and download cookbooks. Chef Clients can also take advantage of Chef Server&apos;s search abilities to dynamically integrate your applications with the rest of your infrastructure.Knife: is the command line interface to Chef. Knife is primarily used to interact with the Chef Server API, and it can be used for local Chef Repository maintenance.Shef: is the interactive Chef shell. Shef allows you to write, run, and debug recipes interactively and also provides a programmatic interface for viewing and editing data on your Chef Server.Chef Server: services HTTP API requests from the Web UI, nodes, and other clients (see above).Chef Server Web UI: the web-based management console for the Chef Server. It manages your infrastructure by making API calls to Chef Server.CouchDB: the primary data store for a Chef server.RabbitMQ: stores and then forwards data from Chef Server to the Chef Solr Indexer. It acts as a buffer for cases when high write loads temporarily exceed the ability of the Chef Solr Indexer to update the search index.Chef Solr Indexer: flattens and expands data to enhance searchability, then writes the data to Chef Solr.Chef Solr: a thin wrapper around the Apache Solr search engine. Chef Solr allows you to find your way around your infrastructure by querying its metadata.
  7. Clients are where all the action happens - the Chef Server and Chef Indexer are largely services that exist only to provide the Client with information.
  8. MerbAPI service for knife &amp; Management consoleRabbitMQSolrChef Server utilizes CouchDB for storing JSON data about Nodes, Roles, and Data Bags.
  9. Config:file_cache_path &quot;/var/chef-solo&quot;cookbook_path &quot;/var/chef-solo/cookbooks”cookbook_path [&quot;/var/chef-solo/cookbooks&quot;, &quot;/var/chef-solo/site-cookbooks&quot;]role_path &quot;/var/chef-solo/roles”chef-solo -c ~/solo.rb -j http://www.example.com/node.json -rhttp://www.example.com/chef-solo.tar.gz
  10. Config:file_cache_path &quot;/var/chef-solo&quot;cookbook_path &quot;/var/chef-solo/cookbooks”cookbook_path [&quot;/var/chef-solo/cookbooks&quot;, &quot;/var/chef-solo/site-cookbooks&quot;]role_path &quot;/var/chef-solo/roles”chef-solo -c ~/solo.rb -j http://www.example.com/node.json -rhttp://www.example.com/chef-solo.tar.gz
  11. Config:file_cache_path &quot;/var/chef-solo&quot;cookbook_path &quot;/var/chef-solo/cookbooks”cookbook_path [&quot;/var/chef-solo/cookbooks&quot;, &quot;/var/chef-solo/site-cookbooks&quot;]role_path &quot;/var/chef-solo/roles”chef-solo -c ~/solo.rb -j http://www.example.com/node.json -rhttp://www.example.com/chef-solo.tar.gz
  12. Hash key value (Mash)Default/override/setAttributes are Node data such as the IP address, hostname, loaded kernel modules, version of programming languages available on the system and more. New attributes can be dynamically added to the node in a variety of ways.During the Chef run, the Chef Client saves these node attributes on the Chef Server where they are indexed for Search. When the Chef Client runs again, it will retrieve the attributes that were saved previously and merge in attributes based on the priority rules described below.
  13. Chef Cookbooks require you to specify a small amount of meta-data. This information is used to provide hints to the Chef Server as to what cookbooks should be deployed to a given node, and in the future it will be integral to an automated system for discovering and installing cookbooks.
  14. Chef Cookbooks require you to specify a small amount of meta-data. This information is used to provide hints to the Chef Server as to what cookbooks should be deployed to a given node, and in the future it will be integral to an automated system for discovering and installing cookbooks.
  15. Search is a feature of the Chef Server that allows you to use a full-text search engine (based on Apache Solr) to query information about your infrastructure and applications. Searches are built by the Chef Server, and allow you to query arbitrary data about your infrastructure. You can utilize this service via search calls in a recipe or the knife search command.Most data that Chef stores in CouchDB is automatically indexed in Solr: Data Bags, API Clients, Nodes, and Roles are all indexed.
  16. Libraries allow you to include arbitrary Ruby code, either to extend Chef&apos;s language or to implement your own classes directly. They are the secret sauce that will allow you to plug in to your existing infrastructure and utilize it to inform how your systems are configured.
  17. Chef Cookbooks require you to specify a small amount of meta-data. This information is used to provide hints to the Chef Server as to what cookbooks should be deployed to a given node, and in the future it will be integral to an automated system for discovering and installing cookbooks.
  18. Template Location Specificity
  19. Recipes are the fundamental configuration in Chef. Recipes encapsulate collections of resources which are executed in the order defined to configure the systemRecipes are an internal Ruby domain-specific language (DSL), but you do not need to have experience with Ruby to write recipes.knife node run list add NODENAME &quot;recipe[apache2]&quot;
  20. Recipes are the fundamental configuration in Chef. Recipes encapsulate collections of resources which are executed in the order defined to configure the systemRecipes are an internal Ruby domain-specific language (DSL), but you do not need to have experience with Ruby to write recipes.knife node run list add NODENAME &quot;recipe[apache2]&quot;