week1 overviewofchef 131016135759 phpapp01

Upload: leenaap

Post on 13-Apr-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    1/61

    mailto:[email protected]:[email protected]
  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    2/61

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    3/61

    Technical Community Manager at Opscode

    Co-host of the Food Fight Show Podcast

    @nathenharvey

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    4/61

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    5/61

    After completing of this webinar series you w

    able toAutomate common infrastructure tasks wit

    Describe Chefs architecture

    Describe Chefs various toolsApply Chefs primitives to solve your proble

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    6/61

    You bring the domain expertise about your b

    and problems Chef provides a framework for solving those

    problems

    Our job is to work together to teach you howexpress solutions to your problems with Che

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    7/61

    Learning Chef is like learning the basics of a

    language 80% fluency will be reached very quickly

    The remaining 20% just takes practice

    The best way to learnChef is touse

    Chef

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    8/61

    Ill post objectives at the beginning of a sect

    Ask questions in the chat window when theyyou

    Well answer as many questions as we canend of the session

    The webinar will be recorded and youll be awatch the recording again.

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    9/61

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    10/61

    Overview of Chef

    Workstation Setup

    Test Node Setup

    Dissecting your first Chef run

    Introducing the Node object Writing your first cookbook

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    11/61

    Setting attributes, cookbook metadata, temp

    Idempotency, notifications, template variable

    Roles

    Using community cookbooks

    Further Resources

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    12/61

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    13/61

    After completing the lesson, you will be able to

    Describe how Chef thinks about Infrastructure Autom Define the following terms:

    Node

    Resource

    Recipe Cookbook

    Run List

    Roles

    Search

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    14/61

    http://www.flickr.com/photos/michaelheiss/3090102907/

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    15/61

    Nodes

    Networking

    Files

    Directories

    Symlinks Mounts

    Routes

    Users

    Groups

    Packages

    Services Filesystems

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    16/61

    Application

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    17/61

    Application

    Application Database

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    18/61

    Application

    App Databases

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    19/61

    App Servers

    App Databases

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    20/61

    App LB

    App Servers

    App Databases

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    21/61

    App LBs

    App Databases

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    22/61

    App LBs

    A

    App DB Cache

    App DBs

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    23/61

    App LBs

    A

    App DB Cache

    App DBs

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    24/61

    Round Robin DNS

    A

    App DB Cache

    App DBs

    Floating IP?

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    25/61

    App LBs

    App Servers

    < Shiny!

    DB slaves

    Cache

    DB Cache

    DBs

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    26/61

    App LBs

    App Servers

    < Shiny!

    DB slaves

    Cache

    DB Cache

    DBs

    Arewe

    monito

    ring??

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    27/61

    But you already

    guessed that, dyou?

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    28/61

    Organizations

    Environments Roles

    Nodes

    Recipes Cookbooks

    Search

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    29/61

    Their InfMy Infrastructure Your Infrastructure

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    30/61

    Completely independent tenants of Enterpris

    Share nothing with other organizations May represent different

    Companies

    Business Units Departments

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    31/61

    Development Staging Production

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    32/61

    Model the life-stages of your applications

    Every Organization starts with a single envir Environments to reflect your patterns and wo

    Development

    Test Staging

    Production

    etc.

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    33/61

    Environments may include data attributes ne

    for configuring your infrastructure The URL of your payment services API

    The location of your package repository

    The version of the Chef configuration files should be used

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    34/61

    Load Balancers

    Application

    DB Cache

    Database

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    35/61

    Roles represent the types of servers in your

    infrastructure Load Balancer

    Application Server

    Database Cache

    Database

    Monitoring

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    36/61

    Roles may include a list of Chef configuratio

    that should be applied. We call this list a Run List

    Roles may include data attributes necessaryconfiguring your infrastructure

    The port that the application server listens

    A list of applications that should be deploye

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    37/61

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    38/61

    Nodes represent the servers in your infrastru

    Nodes may represent physical servers or virservers

    Nodes may represent hardware that you owrepresent compute instances in a public or p

    cloud

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    39/61

    Each Node will

    belong to one Organization belong to one Environment

    have zero or more Roles

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    40/61

    An application, the chef-client, runs on each

    chef-client will gather current system configuration

    download the desired system configurationthe Chef server

    configure the node such that it adheres to policy

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    41/61

    Programmatica

    provision andconfigure comp

    Treat like any ocode base

    Reconstruct bufrom code repodata backup, ametal resource

    http://www.flickr.com/photos/louisb/4555295187/

    http://www.flickr.com/photos/louisb/4555295187/http://www.flickr.com/photos/louisb/4555295187/
  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    42/61

    Chef ensures each Node complies with the

    Policy is determined by the configurations inin each Nodes run list

    Reduce management complexity through ab

    Store the configuration of your infrastructure

    version control

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    43/61

    You define the policy in your Chef configurat

    Your policy states what state each resource be in, but not how to get there

    Chef-client will pull the policy from the Chef and enforce the policy on the Node

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    44/61

    A Resource represents a piece of the system

    desired stateA package that should be installed

    A service that should be running

    A file that should be generated

    A cron job that should be configured

    A user that should be managed

    and more

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    45/61

    Resources are the fundamental building blo

    Chef configuration Resources are gathered into Recipes

    Recipes ensure the system is in the desired

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    46/61

    Configuration files that describe resources a

    desired state Recipes can:

    Install and configure software components

    Manage files

    Deploy applications

    Execute other recipes

    and more

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    47/61

    package "apache2"

    template "/etc/apache2/apache2.conf"do

    source "apache2.conf.erb"

    owner "root"

    group "root"

    mode "0644"

    variables(:allow_override=>"All")

    notifies :reload,"service[apache2]"end

    service "apache2"

    action [:enable

    supports :reloa

    end

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    48/61

    Recipes are stored in

    Cookbooks Cookbooks contain recipes,

    templates, files, customresources, etc

    Code re-use and modularity

    http://www.flickr.com/photos/shu

    http://www.flickr.com/photos/shutterhacks/4474421855/http://www.flickr.com/photos/shutterhacks/4474421855/
  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    49/61

    Enterprise

    Chef

    WhatpolicyshouldIfollow?

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    50/61

    Enterprise

    Chef

    WhatpolicyshouldIfollow?

    recipe[ntp::client]recipe[users]

    role[webserver]

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    51/61

    Enterprise

    Chef

    WhatpolicyshouldIfollow?

    r

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    52/61

    The Run List is a collection of policies that th

    should follow. Chef-client obtains the Run List from the Ch

    Server

    Chef-client ensures the Node complies with

    policy in the Run List

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    53/61

    Search for nodes with Roles

    Find Topology Data

    IP addresses

    Hostnames

    FQDNs

    http:

    http://www.flickr.com/photos/kathycsus/2686772625http://www.flickr.com/photos/kathycsus/2686772625
  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    54/61

    Jboss Ap

    Memcache

    Postgres Slaves

    Postgres Master

    NagiosGraphite

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    55/61

    Jboss Ap

    Memcache

    Postgres Slaves

    Postgres Master

    NagiosGraphite

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    56/61

    Memcache

    Postgres Slaves

    Postgres Master

    NagiosGraphite

    Jboss Ap

    Memcache

    Postgres Slaves

    Postgres Master

    NagiosGraphite

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    57/61

    NagiosGraphite

    NagiosGraphite

    Memcache

    Postgres Slaves

    12+ resource changes for 1 node addition

    Jboss App

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    58/61

    Determine the desired state of your infrastru

    Identify the Resources required to meet that Gather the Resources into Recipes

    Compose a Run List from Recipes and Role

    Apply a Run List to each Node in your Envir

    Your infrastructure adheres to the policy moChef

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    59/61

    Configuration Drift happens when:

    Your infrastructure requirements change The configuration of a server falls out of po

    Chef makes it easy to manage

    Model the new requirements in your Chefconfiguration files

    Run the chef-client to enforce your policies

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    60/61

    In todays webinar, we have

    Described how Chef thinks about Infrastructure Auto

    Defined the following terms:

    Node

    Resource

    Recipe

    Cookbook

    Run List

    Roles

    Search

  • 7/23/2019 Week1 Overviewofchef 131016135759 Phpapp01

    61/61

    mailto:[email protected]:[email protected]