Transcript
Page 1: under the covers -- chef in 20 minutes or less
Page 2: under the covers -- chef in 20 minutes or less

Under The Covers - Chef in 20 Minutes

www.opscode.com

Page 3: under the covers -- chef in 20 minutes or less

• You have a Cloud

• Now what?

http://www.flickr.com/photos/ian_munroe/4758240536/

Congratulations!!!

Page 4: under the covers -- chef in 20 minutes or less

APIs are awesome

• You can provision compute resources in seconds

• You can provision storage resources in seconds

• That’s cool.

http://www.flickr.com/photos/jdhancock/3634246981/

Give me some operating system and put it on the network

Page 5: under the covers -- chef in 20 minutes or less

Chef can help with that

• knife ec2 server create

• knife rackspace server create

• knife terremark server create

• knife gandi server create

• knife bluebox server create

• knife brightbox server create

• knife vsphere server create

• knife openstack server create

• knife eucalyptus server create

http://www.flickr.com/photos/kyz/3122499444/

Page 6: under the covers -- chef in 20 minutes or less

But then what?

http://www.flickr.com/photos/doctorow/2698336843

Page 7: under the covers -- chef in 20 minutes or less

You need to configure them

Give me some operating system and put it on the network

Page 8: under the covers -- chef in 20 minutes or less

Chef can help with that too

• That’s what we do.

Page 9: under the covers -- chef in 20 minutes or less

Golden Images are not the answer

http://www.flickr.com/photos/bankofengland/5762003476

• Gold is heavy

• Hard to transport

• Hard to mold

• Easy to lose configuration detail

Page 10: under the covers -- chef in 20 minutes or less

Chef is Infrastructure as Code

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

• Programmatically provision and configure

• Treat like any other code base

• Reconstruct operations from code repository, data backup, and bare metal resources.

Page 11: under the covers -- chef in 20 minutes or less

Chef configures Resources

http://www.flickr.com/photos/stevekeys/3123167585/

• Nodes

• Networking

• Files

• Directories

• Symlinks

• Mounts

• Routes

• Users and Groups

• Tasks

• Packages

• Software

• Services

• Configurations

• Stuff

Page 12: under the covers -- chef in 20 minutes or less

With declarative interfaces

• Define policy

• Say what, not how

• Pull not Push

http://www.flickr.com/photos/bixentro/2591838509/

Page 13: under the covers -- chef in 20 minutes or less

package "ntp" do action :installend

service "ntpd" do action [:enable,:start]end

template "/etc/ntp.conf" do source "ntp.conf.erb" owner "root" group "root" mode 0644 action :create variables( :ntp_server => “time.example.com”) notifies :restart, “service[ntpd]”end

That looks like this

Page 14: under the covers -- chef in 20 minutes or less

package "net-snmp" do action :installend

service "snmpd" do action [:enable,:start]end

template "/etc/snmpd.conf" do source "snmpd.conf.erb" owner "root" group "root" mode 0644 action :create variables( :community_string => “not_public”) notifies :restart, “service[snmpd]”end

That looks like this

Page 15: under the covers -- chef in 20 minutes or less

Creating recipes and cookbooks

• Recipes are collections of Resources

• Cookbooks contain recipes, Templates, files, custom resources, etc

• Code re-use and modularity

http://www.flickr.com/photos/shutterhacks/4474421855/

Page 16: under the covers -- chef in 20 minutes or less

Apply Run Lists to Nodes

ServerServerServerServer

chef-server

API chef-clientOhai!

Give me recipe[ntp::client]

node

ntp

client.rb

executed in order!

Page 17: under the covers -- chef in 20 minutes or less

ServerServerServerServer

chef-server

API chef-clientOhai!

Give me “ntp::client”,

“openssh::server”

node

ntp

client.rb

openssh

server.rb

Build up reusable code

executed in order!

Page 18: under the covers -- chef in 20 minutes or less

Apply them in order

ServerServerServerServer

chef-server

API chef-client

Ohai! Give me

“recipe[ntp::client]”, “recipe[openssh::server]”,

“recipe[apache]”,“recipe[php]”node

ntp

client.rb

openssh

server.rb

apache

default.rb

php

default.rb

executed in order!

Page 19: under the covers -- chef in 20 minutes or less

Roles

Role

RecipeRecipeRecipe

Role

Role

RecipeRecipeRecipeRole

Recipe

ServerServerServerServer

chef-server

API

Knife

Page 20: under the covers -- chef in 20 minutes or less

ServerServerServerServer

chef-server

API chef-client Ohai! Give me

“role[base]”,“role[webserver]”

node

ntp

client.rb

openssh

server.rb

apache

default.rb

php

default.rb

Roles

Page 21: under the covers -- chef in 20 minutes or less

ServerServerServerServer

chef-server

APIchef-client

“role[webserver]”

node

ntp

client.rb

openssh

server.rb

apache

default.rb

php

default.rb

Roles

chef-client

“role[database]”node

ntp

client.rb

openssh

server.rb

mysql

server.rb

Page 22: under the covers -- chef in 20 minutes or less

Recipes can search chef-sever

• IP addresses

• Hostnames

• FQDNs

• Search for nodes with Roles

• Find configuration data

http://www.flickr.com/photos/fotos_medem/3399096196/

Page 23: under the covers -- chef in 20 minutes or less

App LBs

App Servers

App DB Cache

App DBs

And stitch together Infrastructures

Page 24: under the covers -- chef in 20 minutes or less

App LBs

App Servers

App DB Cache

App DBs

Floating IP?

Your Infrastructure is a snow flake

Page 25: under the covers -- chef in 20 minutes or less

And it Evolves

App LBs

App Servers

NoSQL

DB slaves

Cache

DB Cache

DBs

Page 26: under the covers -- chef in 20 minutes or less

Quickly

DC1

DC3

DC2

Page 27: under the covers -- chef in 20 minutes or less

Build anything

• Simple internal applications

• Complex internal applications

• Workstations

• Hadoop clusters

• IaaS applications

• PaaS applications

• SaaS applications

• Storage systems

• You name it

http://www.flickr.com/photos/hyku/245010680/

Page 28: under the covers -- chef in 20 minutes or less

And manage it simply

http://www.flickr.com/photos/helico/404640681/

• Automatically reconfigure everything

• Load balancers

• Metrics collection systems

• Monitoring systems

• Cloud migrations become trivial

Page 29: under the covers -- chef in 20 minutes or less

Questions?

[email protected]

slides and original talk concept - Sean O’Meara


Top Related