Slide 1

Slide 1 text

Hacking AWS OpsWorks Andy Fleener @andyfleener

Slide 2

Slide 2 text

Sport Ngin Platform January 2013
 March 2013
 June 2014
 February 11, 2015 8 applications running on 2 different “Paas” First new application launches on OpsWorks Decision is made to move all applications to OpsWorks All 25 web applications running on OpsWorks

Slide 3

Slide 3 text

Why Move Running on 3 different platforms was hard None of the 3 fully met our needs Consolidating allowed us to become experts in a 
 single platform

Slide 4

Slide 4 text

Why OpsWorks High level of customizability Did the low level work for us Stayed out of our way Good pricing model Stays fresh by releasing new features

Slide 5

Slide 5 text

What is OpsWorks

Slide 6

Slide 6 text

Rub Some DevOps Cloud DevOps Cloud Application Management On it!

Slide 7

Slide 7 text

No seriously WTF is it?

Slide 8

Slide 8 text

Application Manager Config Management - Chef/OpsWorks Lifecycle orchestration Automated Deployments - Via Chef’s deploy resource Application Stack definitions - Built-in or using custom defined stacks Resource Management - EIPs/EBS/ELBs

Slide 9

Slide 9 text

Primitives Stacks Layers Apps Instances

Slide 10

Slide 10 text

Chef/OpsWorks Agent Chef Solo/Chef Zero OpsWorks Agent Agent pings home to see if it needs to run Chef All life cycle events translate to a Chef run 
 with different run lists.

Slide 11

Slide 11 text

Life Cycle Events Setup Deploy Configure Undeploy Shutdown

Slide 12

Slide 12 text

Other Goodies EIPs EBS Volumes ELBs IAM User Management RDS Integration

Slide 13

Slide 13 text

Cool Story..

Slide 14

Slide 14 text

But will it blend?

Slide 15

Slide 15 text

The Good Everything is an API Direct integration with other Amazon tools Fast release cycle A bit of built in orchestration

Slide 16

Slide 16 text

The Bad User experience is OK-ish It’s not a typical Chef setup Auto Healing is a waste of a feature Not enough orchestration

Slide 17

Slide 17 text

Getting Started

Slide 18

Slide 18 text

Use built-in layers!

Slide 19

Slide 19 text

Questions to Ask Am I going to run this in production? Will this application have users? Do I need zero downtime deployments? Do I care about what software is running on my servers?

Slide 20

Slide 20 text

Don’t use built-in layers

Slide 21

Slide 21 text

Hybrid Approach

Slide 22

Slide 22 text

Custom Layers Reuse OpsWorks’ chef cookbooks Still have full control over the run list Replace parts that don’t meet your needs Use Layers as roles to attach run lists to layers Use custom security groups

Slide 23

Slide 23 text

Shipping all the bits

Slide 24

Slide 24 text

Updating Your Chef All Chef versions use a site-cookbooks pattern Berkshelf can help Watch out for indeterminate dependency resolution All the OpsWorks cookbooks are open source
 https://github.com/aws/opsworks-cookbooks

Slide 25

Slide 25 text

Deploying Your App What’s your deployment strategy? Built-in chef deploys with minimal downtime Work must be done to make them zero downtime

Slide 26

Slide 26 text

Zero Downtime Deploys Two reasonable techniques: - Zero downtime on each instance - Use orchestration to do rolling restarts

Slide 27

Slide 27 text

Leveling Up

Slide 28

Slide 28 text

Improving the UX Automation is key Building good abstractions CLI is faster MOAR Orchestration!!

Slide 29

Slide 29 text

Opsicle https://github.com/sportngin/opsicle

Slide 30

Slide 30 text

What does it do? Deployments Chef Cookbook updates Arbitrary Chef runs Monitor deployment activity ssh / ssh key management Moves management closer to the code

Slide 31

Slide 31 text

Primary Goals Improve the developer experience Build good layers of abstraction Add more automation

Slide 32

Slide 32 text

Road Map More visibility into deployments Instance management (start/stop/create/delete) Stack creation/configuration

Slide 33

Slide 33 text

DEMO TIME! https://github.com/anfleene/opsworks_rails_demo https://github.com/anfleene/opsworks_rails_demo_cookbooks

Slide 34

Slide 34 text

Why not normal Chef?

Slide 35

Slide 35 text

Everything has tradeoffs

Slide 36

Slide 36 text

OpsWorks Easy to get started Built-in server management OpsWorks runs the backend service Removes some of the complex parts of Chef It’s only kind of Chef

Slide 37

Slide 37 text

Chef Server It’s actually Chef Cookbooks from the community will work if you set them up right More freedom about how to run/maintain Bigger investment into ensuring you have a working Chef server Possible single point of failure

Slide 38

Slide 38 text

What Do You All Think?