+ All Categories
Home > Technology > Chef + Environments = Safer Environment

Chef + Environments = Safer Environment

Date post: 29-Jun-2015
Category:
Upload: seth-vargo
View: 1,881 times
Download: 1 times
Share this document with a friend
Description:
http://cl.ly/image/062F2T2W2b2I
Popular Tags:
47
chef + environments safer infrastructure
Transcript
Page 1: Chef + Environments = Safer Environment

chef+ environments safer infrastructure

Page 2: Chef + Environments = Safer Environment

t

f

g

sethvargo

Page 3: Chef + Environments = Safer Environment

what’s an environment?

Page 4: Chef + Environments = Safer Environment
Page 5: Chef + Environments = Safer Environment
Page 6: Chef + Environments = Safer Environment
Page 7: Chef + Environments = Safer Environment
Page 8: Chef + Environments = Safer Environment

{ "name" : "production", "description" : "Production cluster in EC2", "override_attributes" : { ... }, "default_attributes" : { ... }}

Page 9: Chef + Environments = Safer Environment

target specificenvironments

Page 10: Chef + Environments = Safer Environment

$ knife search node "chef_environment:production"

Page 11: Chef + Environments = Safer Environment

$ knife ssh "chef_environment:production" "reboot"

Page 12: Chef + Environments = Safer Environment

default_attributes

override_attributescookbook_versions

chef_type

name

description

Page 13: Chef + Environments = Safer Environment

default_attributes

override_attributescookbook_versions

chef_type

name

description

Page 14: Chef + Environments = Safer Environment

lock cookbooks in production

Page 15: Chef + Environments = Safer Environment

{ "name" : "production", "description" : "Production cluster in EC2", "cookbook_versions" : { "passenger_apache2" : "0.99.4" }, "override_attributes" : { ... }, "default_attributes" : { ... }}

Page 16: Chef + Environments = Safer Environment

“lock” cookbooks in staging

Page 17: Chef + Environments = Safer Environment

{ "name" : "staging", "description" : "Production cluster in EC2", "cookbook_versions" : { "passenger_apache2" : "0.99.4" }, "override_attributes" : { ... }, "default_attributes" : { ... }}

Page 18: Chef + Environments = Safer Environment

unlock cookbooks in development

Page 19: Chef + Environments = Safer Environment

{ "name" : "development", "description" : "Production cluster in EC2", "cookbook_versions" : { ... }, "override_attributes" : { ... }, "default_attributes" : { ... }}

Page 20: Chef + Environments = Safer Environment

updating a cookbook

Page 21: Chef + Environments = Safer Environment

1. test in development

Page 22: Chef + Environments = Safer Environment

2. promote in staging

Page 23: Chef + Environments = Safer Environment

{ "name" : "staging", "description" : "Production cluster in EC2", "cookbook_versions" : { "passenger_apache2" : "0.99.4" }, "override_attributes" : { ... }, "default_attributes" : { ... }}

Page 24: Chef + Environments = Safer Environment

{ "name" : "staging", "description" : "Production cluster in EC2", "cookbook_versions" : { "passenger_apache2" : "0.99.4" }, "override_attributes" : { ... }, "default_attributes" : { ... }}

Page 25: Chef + Environments = Safer Environment

{ "name" : "staging", "description" : "Production cluster in EC2", "cookbook_versions" : { "passenger_apache2" : "1.1.0" // major version bump }, "override_attributes" : { ... }, "default_attributes" : { ... }}

Page 26: Chef + Environments = Safer Environment

$ knife dwim environments/staging.json

1 knife-dwim: https://github.com/mpasternacki/knife-dwim

Page 27: Chef + Environments = Safer Environment

3. verify in staging

Page 28: Chef + Environments = Safer Environment

4. promote in production

Page 29: Chef + Environments = Safer Environment
Page 30: Chef + Environments = Safer Environment

1. run around screaming

Page 31: Chef + Environments = Safer Environment

2. demote in production

Page 32: Chef + Environments = Safer Environment

3. dance (optional)

Page 33: Chef + Environments = Safer Environment
Page 34: Chef + Environments = Safer Environment

scenario:updating passenger

Page 35: Chef + Environments = Safer Environment

default_attributes

override_attributescookbook_versions

chef_type

name

description

Page 36: Chef + Environments = Safer Environment

default_attributes

override_attributescookbook_versions

chef_type

name

description

Page 37: Chef + Environments = Safer Environment

{ "name" : "production", "description" : "Production cluster in EC2", "override_attributes" : { "passenger" : { "version" : "2.1.4" } },}

Page 38: Chef + Environments = Safer Environment

1. test in development

Page 39: Chef + Environments = Safer Environment

2. promote in staging

Page 40: Chef + Environments = Safer Environment

{ "name" : "production", "description" : "Production cluster in EC2", "override_attributes" : { "passenger" : { "version" : "2.1.4" } },}

Page 41: Chef + Environments = Safer Environment

{ "name" : "production", "description" : "Production cluster in EC2", "override_attributes" : { "passenger" : { "version" : "2.1.4" } },}

Page 42: Chef + Environments = Safer Environment

{ "name" : "production", "description" : "Production cluster in EC2", "override_attributes" : { "passenger" : { "version" : "3.0.18" // major version bump } },}

Page 43: Chef + Environments = Safer Environment

$ knife dwim environments/staging.json

1 knife-dwim: https://github.com/mpasternacki/knife-dwim

Page 44: Chef + Environments = Safer Environment

3. verify in staging

Page 45: Chef + Environments = Safer Environment

4. promote in production

Page 46: Chef + Environments = Safer Environment

chef+ environments safer infrastructure

Page 47: Chef + Environments = Safer Environment

t

f

g

sethvargo


Recommended