aws opsworks & chef at the hamburg chef user group 2014

26
© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. AWS OpsWorks & Chef Jonathan Weiss @jweiss January 14 th , 2014

Upload: jonathan-weiss

Post on 08-May-2015

2.085 views

Category:

Technology


5 download

DESCRIPTION

An introduction to AWS OpsWorks and how it uses Chef. Differences between OpsWorks and Chef server. Presented by Jonathan Weiss on January 14th 2014 at the Hamburg Chef User Group.

TRANSCRIPT

Page 1: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.

AWS OpsWorks & Chef

Jonathan Weiss @jweiss

January 14th, 2014

Page 2: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014
Page 3: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

AWS OpsWorks

Integrated Application management on EC2 •  EC2, ELB, VPC, EIP, EBS, … •  Chef-Solo & Built-in layers •  Monitoring with CloudWatch •  Auto Scaling, Auto Healing •  Fine-grained permissions •  App deployment

Page 4: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

AWS Application Management Services

Elastic Beanstalk OpsWorks CloudFormation EC2

Convenience Control

Higher-level Services Do it yourself

Page 5: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

How does it work?

Page 6: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Agent on each EC2 instance

The Heart of the Service

6

Agent on each Amazon EC2 instance

Understands a set of commands that are triggered by AWS OpsWorks. The agent then runs a Chef solo run.

Page 7: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Life Cycle Events

7

setup configure deploy undeploy shutdown

Page 8: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

A Stack

Page 9: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

A Stack with Layers

Page 10: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

A Stack with Layers and Instances

Page 11: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Enough talking

DEMO TIME

Page 12: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Chef in AWS OpsWorks vs. Chef Server

Page 13: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Main Differences

•  Chef Setup •  One run vs. discrete events •  Push vs. pull •  Discovery: search & AWS OpsWorks attribute tree •  Data bags

Page 14: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Chef Setup

Chef Solo &

OpsWorks Backend

Chef Client &

Chef Server

Page 15: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Customization Options Built-in layers Override Chef attributes via custom JSON Override Chef attributes via custom cookbook Overwrite Chef template file Deploy hooks Provide custom recipe to extend built-in layer Provide custom recipe to create custom layer cont

rol

sim

ple

Page 16: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Life Cycle Events

•  Give you fine-grained control •  Faster to execute •  Context

Page 17: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Push vs. Pull

•  On-demand and automatic •  Respond immediately to changes in the stack

Page 18: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Discovery: Chef Search

AWS OpsWorks does not offer attribute search Alternative:

node[:opsworks] with similar capabilities to partial_search

Page 19: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

AWS OpsWorks Attribute Tree

Find all Rails application servers

rails_servers = node['opsworks']['layers']['rails-app']['instances']

rails_ips = rails_servers.map{|i| i['private_ip'] }

template "/etc/rails-server.conf" do

...

variables({

:ips => rails_server_ips

})

end

Page 20: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Encrypted Data Bags

•  Upload encrypted JSON to S3 •  Have instances access via IAM roles in a recipe

Page 21: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Custom JSON

Arbitrary JSON on stack that is available in Chef if node.foo.bar

... elsif node.foo.baz ... end

{ ‘foo‘: { ‘bar‘: true, ‘baz‘: false } }

Page 22: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Store Secrets on Amazon S3

Access from instance via instance profiles bucket = node['acme']['bucket'] key = node['acme']['key'] s3 = AWS::S3.new obj = s3.buckets[bucket].objects[key] obj.read

Page 23: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

The Future

Page 24: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Better Chef Citizen Chef 11.8 local server mode: •  Data bags •  (local) Chef search

Page 25: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

More information about AWS OpsWorks

•  Try it out https://console.aws.amazon.com/opsworks/ •  Follow us on twitter @AWSOpsWorks •  Find us on YouTube •  Blog http://blogs.aws.amazon.com/application-management •  Docs http://aws.amazon.com/documentation/opsworks/ •  User tests [email protected] •  Work with us http://jobs.aws-berlin.com

Page 26: AWS OpsWorks & Chef at the Hamburg Chef User Group 2014

Thank You

@jweiss