chef intro @ sf bay area lspe meetup

Download Chef Intro @ SF Bay Area LSPE meetup

Post on 30-Jul-2015

4.129 views

Category:

Technology

1 download

Embed Size (px)

TRANSCRIPT

  • Infrastructure Automationwith Chef

    Marius Ducea

    SF Bay Area #LSPESep 23, 2010

  • whoami

    System Administrator Web Operations Engineer Consultant

  • http://www.flickr.com/photos/dunechaser/161509118/

  • Chef history

    March 2008 first commit September 2008 Opscode founded January 2009 public release Today v0.9.8

  • Key Chef Principles

    Idempotent Extensible, uses ruby as the configuration language Prefers failure over non-deterministic "success" Order matters, simplifying dependencies Chef Clients do most of the work, not the server.

  • Chef-Server

    Chef-Server Chef-Solo Opscode Platform

  • Chef-Solo

    run chef without a serverno scalability issuesno search

    Chef-Server Chef-Solo Opscode Platform

  • Opscode Platform

    Chef-Server Chef-Solo Opscode Platform

  • Chef-Client

    Chef-Client Ohai

    runs on all your nodesexecutes its recipes locallyruns as a daemon or from cron

  • separate project

    provides metadata from thelocal system to chef-client

    this info can be used inrecipes or templates

    produces a JSON data blob

    Ohai

    Chef-Client Ohai

  • Nodes

    Roles

    Cookbooks

    Chef components

    Node

    any system than runs chef-clienthas a run listrecipes and roles are applied in order

  • Nodes

    Roles

    Cookbooks

    Chef components

    Role

  • Nodes

    Roles

    Cookbooks

    Chef components

    RecipeRecipes

    Attributes

    Templates

    Metadata

  • Nodes

    Roles

    Cookbooks

    Chef components

    AttributesRecipes

    Attributes

    Templates

    Metadata

  • Nodes

    Roles

    Cookbooks

    Chef components

    TemplateRecipes

    Attributes

    Templates

    Metadata

  • Nodes

    Roles

    Cookbooks

    Chef components

    MetadataRecipes

    Attributes

    Templates

    Metadata

  • Nodes

    Roles

    Cookbooks

    Chef components

    CookbookRecipes

    Attributes

    Templates

    Metadata

  • Nodes

    Roles

    Cookbooks

    Reuse

    CookbooksRecipes

    Attributes

    Templates

    Metadata

  • Nodes

    Roles

    Cookbooks

    Share

    cookbooks.opscode.comRecipes

    Attributes

    Templates

    Metadata

  • Nodes

    Roles

    Cookbooks

    Chef components

    Recipes

    Attributes

    Templates

    Metadata

    Search Search

    sample nagios & nrpe recipe

  • Nodes

    Roles

    Cookbooks

    Chef components

    nrpe recipeRecipes

    Attributes

    Templates

    Metadata

    Search

  • Nodes

    Roles

    Cookbooks

    Chef components

    nagios recipeRecipes

    Attributes

    Templates

    Metadata

    Search

  • Workflow

    First you'll need a chef-repo

    (git clone git://github.com/opscode/chef-repo.git)

    cookbooks/ - Cookbooks you download or create.

    roles/ - Store roles in .rb or .json in the repository.

    Use rake tasks to upload to the chef server

    (rake roles upload_cookbooks)

    http://wiki.opscode.com/display/chef/Chef+Repository

  • knife

    command line utility

    uses the chef-server api.

    it can create/update/delete roles, cookbooks

    has support for various cloud providers like ec2,

    rackspace:

    knife ec2 server list

    knife ec2 server create "role[Web]" -i ami-1634de7f -f t1.micro -x ubuntu -I ~/.ssh/id_rsa-my-keypair -S my-keypair

    http://wiki.opscode.com/display/chef/Knife

  • Contributing to chef

    Apache license version 2

    Very active and helpful community

    Fill out the CLA

    Github used for opscode projects

    (chef/cookbooks/ohai)

    Fork the project, work on topic branches.

    http://wiki.opscode.com/display/chef/Working+with+git

    http://wiki.opscode.com/display/chef/How+to+Contribute

  • Chef is awesome...

    a library for configuration management an api for your entire infrastructure powerful search sharable cookbooks

    Keep in mind... chef is still young limited os support ubuntu love

  • Questions?

    Marius Ducea

    marius@promethost.com

    @mariusducea

    github.com/mdxp/cookbooks

    blog: www.ducea.com

    site: promethost.com

    slides: slideshare.net/mdxp